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:
+3
-3
@@ -108,7 +108,7 @@ func (dst *Json) DecodeBinary(ci *ConnInfo, src []byte) error {
|
||||
return dst.DecodeText(ci, src)
|
||||
}
|
||||
|
||||
func (src Json) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
func (src *Json) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
switch src.Status {
|
||||
case Null:
|
||||
return true, nil
|
||||
@@ -120,7 +120,7 @@ func (src Json) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
return false, err
|
||||
}
|
||||
|
||||
func (src Json) EncodeBinary(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
func (src *Json) EncodeBinary(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
return src.EncodeText(ci, w)
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ func (dst *Json) Scan(src interface{}) error {
|
||||
}
|
||||
|
||||
// Value implements the database/sql/driver Valuer interface.
|
||||
func (src Json) Value() (driver.Value, error) {
|
||||
func (src *Json) Value() (driver.Value, error) {
|
||||
switch src.Status {
|
||||
case Present:
|
||||
return string(src.Bytes), nil
|
||||
|
||||
Reference in New Issue
Block a user