Use github.com/pkg/errors
This commit is contained in:
+5
-4
@@ -3,7 +3,8 @@ package pgtype
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type Text struct {
|
||||
@@ -36,7 +37,7 @@ func (dst *Text) Set(src interface{}) error {
|
||||
if originalSrc, ok := underlyingStringType(src); ok {
|
||||
return dst.Set(originalSrc)
|
||||
}
|
||||
return fmt.Errorf("cannot convert %v to Text", value)
|
||||
return errors.Errorf("cannot convert %v to Text", value)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -73,7 +74,7 @@ func (src *Text) AssignTo(dst interface{}) error {
|
||||
return NullAssignTo(dst)
|
||||
}
|
||||
|
||||
return fmt.Errorf("cannot decode %v into %T", src, dst)
|
||||
return errors.Errorf("cannot decode %v into %T", src, dst)
|
||||
}
|
||||
|
||||
func (dst *Text) DecodeText(ci *ConnInfo, src []byte) error {
|
||||
@@ -121,7 +122,7 @@ func (dst *Text) Scan(src interface{}) error {
|
||||
return dst.DecodeText(nil, srcCopy)
|
||||
}
|
||||
|
||||
return fmt.Errorf("cannot scan %T", src)
|
||||
return errors.Errorf("cannot scan %T", src)
|
||||
}
|
||||
|
||||
// Value implements the database/sql/driver Valuer interface.
|
||||
|
||||
Reference in New Issue
Block a user