Use Go 1.13 errors instead of xerrors
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user