Use pointer methods for all struct pgtypes
Now no need to no whether certain interfaces are implemented by struct or pointer to struct.
This commit is contained in:
@@ -25,8 +25,8 @@ func (dst *GenericText) DecodeText(ci *ConnInfo, src []byte) error {
|
||||
return (*Text)(dst).DecodeText(ci, src)
|
||||
}
|
||||
|
||||
func (src GenericText) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
return (Text)(src).EncodeText(ci, w)
|
||||
func (src *GenericText) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
return (*Text)(src).EncodeText(ci, w)
|
||||
}
|
||||
|
||||
// Scan implements the database/sql Scanner interface.
|
||||
@@ -35,6 +35,6 @@ func (dst *GenericText) Scan(src interface{}) error {
|
||||
}
|
||||
|
||||
// Value implements the database/sql/driver Valuer interface.
|
||||
func (src GenericText) Value() (driver.Value, error) {
|
||||
return (Text)(src).Value()
|
||||
func (src *GenericText) Value() (driver.Value, error) {
|
||||
return (*Text)(src).Value()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user