fixed bug: Scan used value receiver and not pointer

This commit is contained in:
marco 2016-02-09 13:14:00 +01:00
parent ef9a220565
commit 0978fe0e3d
1 changed files with 2 additions and 2 deletions

4
sql.go
View File

@ -7,7 +7,7 @@ const valueMethod = `func (i %[1]s) Value() (driver.Value, error) {
}
`
const scanMethod = `func (i %[1]s) Scan(value interface{}) error {
const scanMethod = `func (i *%[1]s) Scan(value interface{}) error {
bytes, ok := value.([]byte)
if !ok {
return fmt.Errorf("value is not a byte slice")
@ -20,7 +20,7 @@ const scanMethod = `func (i %[1]s) Scan(value interface{}) error {
return err
}
i = val
*i = val
return nil
}
`