2
0

Use errors instead of golang.org/x/xerrors

This commit is contained in:
Jack Christensen
2021-03-25 09:55:12 -04:00
parent 80147fd7cc
commit a49f4bb135
15 changed files with 47 additions and 56 deletions
+1 -2
View File
@@ -9,7 +9,6 @@ import (
"github.com/jackc/pgconn"
"github.com/jackc/pgio"
errors "golang.org/x/xerrors"
)
// CopyFromRows returns a CopyFromSource interface over the provided rows slice
@@ -174,7 +173,7 @@ func (ct *copyFrom) buildCopyBuf(buf []byte, sd *pgconn.StatementDescription) (b
return false, nil, err
}
if len(values) != len(ct.columnNames) {
return false, nil, errors.Errorf("expected %d values, got %d values", len(ct.columnNames), len(values))
return false, nil, fmt.Errorf("expected %d values, got %d values", len(ct.columnNames), len(values))
}
buf = pgio.AppendInt16(buf, int16(len(ct.columnNames)))