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
+4 -3
View File
@@ -2,7 +2,8 @@ package pgtype
import (
"database/sql/driver"
"fmt"
"github.com/pkg/errors"
)
type JSONB JSON
@@ -30,11 +31,11 @@ func (dst *JSONB) DecodeBinary(ci *ConnInfo, src []byte) error {
}
if len(src) == 0 {
return fmt.Errorf("jsonb too short")
return errors.Errorf("jsonb too short")
}
if src[0] != 1 {
return fmt.Errorf("unknown jsonb version number %d", src[0])
return errors.Errorf("unknown jsonb version number %d", src[0])
}
*dst = JSONB{Bytes: src[1:], Status: Present}