Use golang.org/x/xerrors

pull/483/head
Jack Christensen 2019-04-20 17:43:44 -05:00
parent efb333df6b
commit cc3461e65d
79 changed files with 79 additions and 79 deletions

View File

@ -5,7 +5,7 @@ import (
"github.com/jackc/pgconn" "github.com/jackc/pgconn"
"github.com/jackc/pgx/v4/pgtype" "github.com/jackc/pgx/v4/pgtype"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type batchItem struct { type batchItem struct {

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
"github.com/jackc/pgconn" "github.com/jackc/pgconn"
"github.com/jackc/pgproto3/v2" "github.com/jackc/pgproto3/v2"

View File

@ -7,7 +7,7 @@ import (
"io" "io"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// CopyFromRows returns a CopyFromSource interface over the provided rows slice // CopyFromRows returns a CopyFromSource interface over the provided rows slice

View File

@ -9,7 +9,7 @@ import (
"github.com/jackc/pgconn" "github.com/jackc/pgconn"
"github.com/jackc/pgx/v4" "github.com/jackc/pgx/v4"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
func TestConnCopyFromSmall(t *testing.T) { func TestConnCopyFromSmall(t *testing.T) {

View File

@ -9,7 +9,7 @@ import (
"github.com/jackc/pgx/v4" "github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgtype" "github.com/jackc/pgx/v4/pgtype"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
var pointRegexp *regexp.Regexp = regexp.MustCompile(`^\((.*),(.*)\)$`) var pointRegexp *regexp.Regexp = regexp.MustCompile(`^\((.*),(.*)\)$`)

View File

@ -4,7 +4,7 @@ import (
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// The values for log levels are chosen such that the zero value means that no // The values for log levels are chosen such that the zero value means that no

View File

@ -5,7 +5,7 @@ import (
"net" "net"
"reflect" "reflect"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
"github.com/jackc/pgproto3/v2" "github.com/jackc/pgproto3/v2"
"github.com/jackc/pgx/v4/pgtype" "github.com/jackc/pgx/v4/pgtype"

View File

@ -3,7 +3,7 @@ package pgtype
import ( import (
"database/sql/driver" "database/sql/driver"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// ACLItem is used for PostgreSQL's aclitem data type. A sample aclitem // ACLItem is used for PostgreSQL's aclitem data type. A sample aclitem

View File

@ -3,7 +3,7 @@ package pgtype
import ( import (
"database/sql/driver" "database/sql/driver"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type ACLItemArray struct { type ACLItemArray struct {

View File

@ -9,7 +9,7 @@ import (
"unicode" "unicode"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// Information on the internals of PostgreSQL arrays can be found in // Information on the internals of PostgreSQL arrays can be found in

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"strconv" "strconv"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Bool struct { type Bool struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type BoolArray struct { type BoolArray struct {

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Box struct { type Box struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type BPCharArray struct { type BPCharArray struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"encoding/hex" "encoding/hex"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Bytea struct { type Bytea struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type ByteaArray struct { type ByteaArray struct {

View File

@ -6,7 +6,7 @@ import (
"net" "net"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type CIDRArray struct { type CIDRArray struct {

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Circle struct { type Circle struct {

View File

@ -5,7 +5,7 @@ import (
"reflect" "reflect"
"time" "time"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
const maxUint = ^uint(0) const maxUint = ^uint(0)

View File

@ -3,7 +3,7 @@ package pgtype
import ( import (
"database/sql/driver" "database/sql/driver"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
func DatabaseSQLValue(ci *ConnInfo, src Value) (interface{}, error) { func DatabaseSQLValue(ci *ConnInfo, src Value) (interface{}, error) {

View File

@ -6,7 +6,7 @@ import (
"time" "time"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Date struct { type Date struct {

View File

@ -6,7 +6,7 @@ import (
"time" "time"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type DateArray struct { type DateArray struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Daterange struct { type Daterange struct {

View File

@ -3,7 +3,7 @@ package pgtype
import ( import (
"database/sql/driver" "database/sql/driver"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type EnumArray struct { type EnumArray struct {

View File

@ -3,7 +3,7 @@ package uuid
import ( import (
"database/sql/driver" "database/sql/driver"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
"github.com/jackc/pgx/v4/pgtype" "github.com/jackc/pgx/v4/pgtype"
uuid "github.com/satori/go.uuid" uuid "github.com/satori/go.uuid"

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"strconv" "strconv"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
"github.com/jackc/pgx/v4/pgtype" "github.com/jackc/pgx/v4/pgtype"
"github.com/shopspring/decimal" "github.com/shopspring/decimal"

View File

@ -7,7 +7,7 @@ import (
"strconv" "strconv"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Float4 struct { type Float4 struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Float4Array struct { type Float4Array struct {

View File

@ -7,7 +7,7 @@ import (
"strconv" "strconv"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Float8 struct { type Float8 struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Float8Array struct { type Float8Array struct {

View File

@ -8,7 +8,7 @@ import (
"unicode" "unicode"
"unicode/utf8" "unicode/utf8"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
"github.com/jackc/pgio" "github.com/jackc/pgio"
) )

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type HstoreArray struct { type HstoreArray struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"net" "net"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// Network address family is dependent on server socket.h value for AF_INET. // Network address family is dependent on server socket.h value for AF_INET.

View File

@ -6,7 +6,7 @@ import (
"net" "net"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type InetArray struct { type InetArray struct {

View File

@ -7,7 +7,7 @@ import (
"strconv" "strconv"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Int2 struct { type Int2 struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Int2Array struct { type Int2Array struct {

View File

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Int4 struct { type Int4 struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Int4Array struct { type Int4Array struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Int4range struct { type Int4range struct {

View File

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Int8 struct { type Int8 struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Int8Array struct { type Int8Array struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Int8range struct { type Int8range struct {

View File

@ -9,7 +9,7 @@ import (
"time" "time"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
const ( const (

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"encoding/json" "encoding/json"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type JSON struct { type JSON struct {

View File

@ -3,7 +3,7 @@ package pgtype
import ( import (
"database/sql/driver" "database/sql/driver"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type JSONB JSON type JSONB JSON

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Line struct { type Line struct {

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Lseg struct { type Lseg struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"net" "net"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Macaddr struct { type Macaddr struct {

View File

@ -6,7 +6,7 @@ import (
"net" "net"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type MacaddrArray struct { type MacaddrArray struct {

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// PostgreSQL internal numeric storage uses 16-bit "digits" with base of 10,000 // PostgreSQL internal numeric storage uses 16-bit "digits" with base of 10,000

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type NumericArray struct { type NumericArray struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Numrange struct { type Numrange struct {

View File

@ -6,7 +6,7 @@ import (
"strconv" "strconv"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// OID (Object Identifier Type) is, according to // OID (Object Identifier Type) is, according to

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Path struct { type Path struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql" "database/sql"
"reflect" "reflect"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// PostgreSQL oids for common types // PostgreSQL oids for common types

View File

@ -7,7 +7,7 @@ import (
"strconv" "strconv"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// pguint32 is the core type that is used to implement PostgreSQL types such as // pguint32 is the core type that is used to implement PostgreSQL types such as

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Vec2 struct { type Vec2 struct {

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Polygon struct { type Polygon struct {

View File

@ -4,7 +4,7 @@ import (
"math" "math"
"strconv" "strconv"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// QChar is for PostgreSQL's special 8-bit-only "char" type more akin to the C // QChar is for PostgreSQL's special 8-bit-only "char" type more akin to the C

View File

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type BoundType byte type BoundType byte

View File

@ -4,7 +4,7 @@ import (
"encoding/binary" "encoding/binary"
"reflect" "reflect"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// Record is the generic PostgreSQL record type such as is created with the // Record is the generic PostgreSQL record type such as is created with the

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"encoding/json" "encoding/json"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Text struct { type Text struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type TextArray struct { type TextArray struct {

View File

@ -8,7 +8,7 @@ import (
"strings" "strings"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// TID is PostgreSQL's Tuple Identifier type. // TID is PostgreSQL's Tuple Identifier type.

View File

@ -6,7 +6,7 @@ import (
"time" "time"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
const pgTimestampFormat = "2006-01-02 15:04:05.999999999" const pgTimestampFormat = "2006-01-02 15:04:05.999999999"

View File

@ -6,7 +6,7 @@ import (
"time" "time"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type TimestampArray struct { type TimestampArray struct {

View File

@ -6,7 +6,7 @@ import (
"time" "time"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
const pgTimestamptzHourFormat = "2006-01-02 15:04:05.999999999Z07" const pgTimestamptzHourFormat = "2006-01-02 15:04:05.999999999Z07"

View File

@ -6,7 +6,7 @@ import (
"time" "time"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type TimestamptzArray struct { type TimestamptzArray struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Tsrange struct { type Tsrange struct {

View File

@ -4,7 +4,7 @@ import (
"database/sql/driver" "database/sql/driver"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Tstzrange struct { type Tstzrange struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type UUID struct { type UUID struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type UUIDArray struct { type UUIDArray struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type Varbit struct { type Varbit struct {

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type VarcharArray struct { type VarcharArray struct {

View File

@ -6,7 +6,7 @@ import (
"reflect" "reflect"
"time" "time"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
"github.com/jackc/pgconn" "github.com/jackc/pgconn"
"github.com/jackc/pgx/v4/pgtype" "github.com/jackc/pgx/v4/pgtype"

View File

@ -7,7 +7,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
"github.com/jackc/pgconn" "github.com/jackc/pgconn"
"github.com/jackc/pgio" "github.com/jackc/pgio"

View File

@ -9,7 +9,7 @@ package pgx_test
// "testing" // "testing"
// "time" // "time"
// "github.com/pkg/errors" // errors "golang.org/x/xerrors"
// "github.com/jackc/fake" // "github.com/jackc/fake"
// "github.com/jackc/pgx/v4" // "github.com/jackc/pgx/v4"

2
tx.go
View File

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"github.com/jackc/pgconn" "github.com/jackc/pgconn"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
type TxIsoLevel string type TxIsoLevel string

View File

@ -9,7 +9,7 @@ import (
"github.com/jackc/pgio" "github.com/jackc/pgio"
"github.com/jackc/pgx/v4/pgtype" "github.com/jackc/pgx/v4/pgtype"
"github.com/pkg/errors" errors "golang.org/x/xerrors"
) )
// PostgreSQL format codes // PostgreSQL format codes