Skip to content

Instantly share code, notes, and snippets.

@pavelz
Last active October 12, 2016 11:31
Show Gist options
  • Save pavelz/f58fdd52bc5a24fcfaf373ff56879a74 to your computer and use it in GitHub Desktop.
Save pavelz/f58fdd52bc5a24fcfaf373ff56879a74 to your computer and use it in GitHub Desktop.
package models
import (
"fmt"
)
type Inet struct {
Address string
Valid bool
}
func (i *Inet) Scan(value interface{}) error {
if value == nil {
i.Address, i.Valid = "", false
return nil
}
i.Valid = true
i.Address = fmt.Sprintf("%s", value)
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment