2
0

Use github.com/pkg/errors

This commit is contained in:
Jack Christensen
2017-06-04 21:30:03 -05:00
parent 3ea41e6972
commit 8f4178b3d3
86 changed files with 639 additions and 597 deletions
+5 -4
View File
@@ -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.