mirror of https://github.com/dmarkham/enumer.git
fixed bug: Scan used value receiver and not pointer
This commit is contained in:
parent
ef9a220565
commit
0978fe0e3d
4
sql.go
4
sql.go
|
@ -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
|
||||
}
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue