2
0

Use Go 1.13 errors instead of xerrors

This commit is contained in:
Jack Christensen
2021-03-25 09:01:59 -04:00
parent aa89720576
commit dd160540c4
80 changed files with 927 additions and 956 deletions
+6 -7
View File
@@ -9,7 +9,6 @@ import (
"strings"
"github.com/jackc/pgio"
errors "golang.org/x/xerrors"
)
type Path struct {
@@ -19,7 +18,7 @@ type Path struct {
}
func (dst *Path) Set(src interface{}) error {
return errors.Errorf("cannot convert %v to Path", src)
return fmt.Errorf("cannot convert %v to Path", src)
}
func (dst Path) Get() interface{} {
@@ -34,7 +33,7 @@ func (dst Path) Get() interface{} {
}
func (src *Path) AssignTo(dst interface{}) error {
return errors.Errorf("cannot assign %v to %T", src, dst)
return fmt.Errorf("cannot assign %v to %T", src, dst)
}
func (dst *Path) DecodeText(ci *ConnInfo, src []byte) error {
@@ -44,7 +43,7 @@ func (dst *Path) DecodeText(ci *ConnInfo, src []byte) error {
}
if len(src) < 7 {
return errors.Errorf("invalid length for Path: %v", len(src))
return fmt.Errorf("invalid length for Path: %v", len(src))
}
closed := src[0] == '('
@@ -87,7 +86,7 @@ func (dst *Path) DecodeBinary(ci *ConnInfo, src []byte) error {
}
if len(src) < 5 {
return errors.Errorf("invalid length for Path: %v", len(src))
return fmt.Errorf("invalid length for Path: %v", len(src))
}
closed := src[0] == 1
@@ -96,7 +95,7 @@ func (dst *Path) DecodeBinary(ci *ConnInfo, src []byte) error {
rp := 5
if 5+pointCount*16 != len(src) {
return errors.Errorf("invalid length for Path with %d points: %v", pointCount, len(src))
return fmt.Errorf("invalid length for Path with %d points: %v", pointCount, len(src))
}
points := make([]Vec2, pointCount)
@@ -187,7 +186,7 @@ func (dst *Path) Scan(src interface{}) error {
return dst.DecodeText(nil, srcCopy)
}
return errors.Errorf("cannot scan %T", src)
return fmt.Errorf("cannot scan %T", src)
}
// Value implements the database/sql/driver Valuer interface.