Last active
October 12, 2016 11:31
-
-
Save pavelz/f58fdd52bc5a24fcfaf373ff56879a74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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