Use github.com/pkg/errors
This commit is contained in:
+4
-3
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user