pgx icon indicating copy to clipboard operation
pgx copied to clipboard

`driver.Valuer` not handled properly on pointer receivers

Open johngibb opened this issue 6 years ago • 7 comments

Because the encodePreparedStatementArgument dereferences the pointer before checking for the driver.Valuer interface, it will never be used for types which define Value() on a pointer receiver.

i.e. this works:

type MyType struct {}
func (m MyType) Value() (driver.Value, error)

but this doesn't

type MyType struct {}
func (m *MyType) Value() (driver.Value, error)

johngibb avatar Aug 03 '18 20:08 johngibb