This is an automated email from the ASF dual-hosted git repository.

francischuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git


The following commit(s) were added to refs/heads/master by this push:
     new b5a9015  [CALCITE-5063] Replace golang.org/x/xerrors package with 
errors package in stdlib
b5a9015 is described below

commit b5a901540b040c42b6228fe291a2e6f86fbb07cb
Author: Francis Chuang <[email protected]>
AuthorDate: Thu Mar 24 09:20:15 2022 +1100

    [CALCITE-5063] Replace golang.org/x/xerrors package with errors package in 
stdlib
---
 class_mappings.go       |  4 ++--
 compat_go18.go          |  6 +++---
 connection.go           | 14 +++++++-------
 connection_go18.go      | 21 +++++++++++----------
 driver.go               |  8 ++++----
 dsn.go                  | 30 +++++++++++++++---------------
 go.mod                  |  1 -
 http_client.go          | 19 +++++++++----------
 http_client_wrappers.go | 14 +++++++-------
 result.go               |  6 ++----
 statement.go            |  4 ++--
 statement_go18.go       |  8 ++++----
 12 files changed, 66 insertions(+), 69 deletions(-)

diff --git a/class_mappings.go b/class_mappings.go
index 95fa153..4790c51 100644
--- a/class_mappings.go
+++ b/class_mappings.go
@@ -18,10 +18,10 @@
 package avatica
 
 import (
+       "fmt"
        "strings"
 
        avaticaMessage "github.com/apache/calcite-avatica-go/v5/message"
-       "golang.org/x/xerrors"
        "google.golang.org/protobuf/proto"
 )
 
@@ -121,6 +121,6 @@ func responseFromClassName(className string) 
(proto.Message, error) {
        case "SyncResultsResponse":
                return &avaticaMessage.SyncResultsResponse{}, nil
        default:
-               return nil, xerrors.Errorf("unable to create response from the 
string: %s", className)
+               return nil, fmt.Errorf("unable to create response from the 
string: %s", className)
        }
 }
diff --git a/compat_go18.go b/compat_go18.go
index f9d9029..2bd3525 100644
--- a/compat_go18.go
+++ b/compat_go18.go
@@ -1,3 +1,4 @@
+//go:build go1.8
 // +build go1.8
 
 /*
@@ -21,8 +22,7 @@ package avatica
 
 import (
        "database/sql/driver"
-
-       "golang.org/x/xerrors"
+       "fmt"
 )
 
 func driverNamedValueToNamedValue(values []driver.NamedValue) ([]namedValue, 
error) {
@@ -32,7 +32,7 @@ func driverNamedValueToNamedValue(values []driver.NamedValue) 
([]namedValue, err
                list[i] = namedValue(nv)
 
                if nv.Name != "" {
-                       return list, xerrors.Errorf("named parameters are not 
supported: %s given", nv.Name)
+                       return list, fmt.Errorf("named parameters are not 
supported: %s given", nv.Name)
                }
        }
 
diff --git a/connection.go b/connection.go
index 8cd8ac4..2307c5c 100644
--- a/connection.go
+++ b/connection.go
@@ -20,10 +20,10 @@ package avatica
 import (
        "context"
        "database/sql/driver"
+       "errors"
 
-       "github.com/apache/calcite-avatica-go/v5/errors"
+       avaticaErrors "github.com/apache/calcite-avatica-go/v5/errors"
        "github.com/apache/calcite-avatica-go/v5/message"
-       "golang.org/x/xerrors"
 )
 
 type conn struct {
@@ -208,7 +208,7 @@ func (c *conn) avaticaErrorToResponseErrorOrError(err 
error) error {
 
        var avaticaErr avaticaError
 
-       ok := xerrors.As(err, &avaticaErr)
+       ok := errors.As(err, &avaticaErr)
 
        if !ok {
                return err
@@ -218,13 +218,13 @@ func (c *conn) avaticaErrorToResponseErrorOrError(err 
error) error {
                return 
c.adapter.ErrorResponseToResponseError(avaticaErr.message)
        }
 
-       return errors.ResponseError{
+       return avaticaErrors.ResponseError{
                Exceptions:   avaticaErr.message.Exceptions,
                ErrorMessage: avaticaErr.message.ErrorMessage,
                Severity:     int8(avaticaErr.message.Severity),
-               ErrorCode:    errors.ErrorCode(avaticaErr.message.ErrorCode),
-               SqlState:     errors.SQLState(avaticaErr.message.SqlState),
-               Metadata: &errors.RPCMetadata{
+               ErrorCode:    
avaticaErrors.ErrorCode(avaticaErr.message.ErrorCode),
+               SqlState:     
avaticaErrors.SQLState(avaticaErr.message.SqlState),
+               Metadata: &avaticaErrors.RPCMetadata{
                        ServerAddress: 
message.ServerAddressFromMetadata(avaticaErr.message),
                },
        }
diff --git a/connection_go18.go b/connection_go18.go
index 9e9c4f1..ff9fe04 100644
--- a/connection_go18.go
+++ b/connection_go18.go
@@ -1,3 +1,4 @@
+//go:build go1.8
 // +build go1.8
 
 /*
@@ -23,14 +24,14 @@ import (
        "context"
        "database/sql"
        "database/sql/driver"
-
-       "golang.org/x/xerrors"
+       "errors"
+       "fmt"
 )
 
 func (c *conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, 
error) {
 
        if opts.ReadOnly {
-               return nil, xerrors.New("read-only transactions are not 
supported")
+               return nil, errors.New("read-only transactions are not 
supported")
        }
 
        var isolation isoLevel
@@ -43,17 +44,17 @@ func (c *conn) BeginTx(ctx context.Context, opts 
driver.TxOptions) (driver.Tx, e
        case sql.LevelReadCommitted:
                isolation = isolationReadComitted
        case sql.LevelWriteCommitted:
-               return nil, xerrors.New("LevelWriteCommitted isolation level is 
not supported")
+               return nil, errors.New("LevelWriteCommitted isolation level is 
not supported")
        case sql.LevelRepeatableRead:
                isolation = isolationRepeatableRead
        case sql.LevelSnapshot:
-               return nil, xerrors.New("LevelSnapshot isolation level is not 
supported")
+               return nil, errors.New("LevelSnapshot isolation level is not 
supported")
        case sql.LevelSerializable:
                isolation = isolationSerializable
        case sql.LevelLinearizable:
-               return nil, xerrors.New("LevelLinearizable isolation level is 
not supported")
+               return nil, errors.New("LevelLinearizable isolation level is 
not supported")
        default:
-               return nil, xerrors.Errorf("unsupported transaction isolation 
level: %d", opts.Isolation)
+               return nil, fmt.Errorf("unsupported transaction isolation 
level: %d", opts.Isolation)
        }
 
        return c.begin(ctx, isolation)
@@ -67,7 +68,7 @@ func (c *conn) ExecContext(ctx context.Context, query string, 
args []driver.Name
        list, err := driverNamedValueToNamedValue(args)
 
        if err != nil {
-               return nil, xerrors.Errorf("could not execute statement: %v", 
err)
+               return nil, fmt.Errorf("could not execute statement: %w", err)
        }
 
        return c.exec(ctx, query, list)
@@ -78,7 +79,7 @@ func (c *conn) Ping(ctx context.Context) error {
        _, err := c.ExecContext(ctx, c.adapter.GetPingStatement(), 
[]driver.NamedValue{})
 
        if err != nil {
-               return xerrors.Errorf("error pinging database: %v", err)
+               return fmt.Errorf("error pinging database: %w", err)
        }
 
        return nil
@@ -88,7 +89,7 @@ func (c *conn) QueryContext(ctx context.Context, query 
string, args []driver.Nam
        list, err := driverNamedValueToNamedValue(args)
 
        if err != nil {
-               return nil, xerrors.Errorf("could not execute query: %v", err)
+               return nil, fmt.Errorf("could not execute query: %w", err)
        }
 
        return c.query(ctx, query, list)
diff --git a/driver.go b/driver.go
index 59f3dcb..e5c3388 100644
--- a/driver.go
+++ b/driver.go
@@ -35,6 +35,7 @@ import (
        "context"
        "database/sql"
        "database/sql/driver"
+       "fmt"
        "net/http"
 
        "github.com/apache/calcite-avatica-go/v5/generic"
@@ -42,7 +43,6 @@ import (
        "github.com/apache/calcite-avatica-go/v5/message"
        "github.com/apache/calcite-avatica-go/v5/phoenix"
        "github.com/hashicorp/go-uuid"
-       "golang.org/x/xerrors"
 )
 
 // Driver is exported to allow it to be used directly.
@@ -66,18 +66,18 @@ func (c *Connector) Connect(context.Context) (driver.Conn, 
error) {
        config, err := ParseDSN(c.dsn)
 
        if err != nil {
-               return nil, xerrors.Errorf("unable to open connection: %v", err)
+               return nil, fmt.Errorf("unable to open connection: %w", err)
        }
 
        httpClient, err := NewHTTPClient(config.endpoint, c.Client, config)
 
        if err != nil {
-               return nil, xerrors.Errorf("unable to create HTTP client: %v", 
err)
+               return nil, fmt.Errorf("unable to create HTTP client: %w", err)
        }
 
        connectionId, err := uuid.GenerateUUID()
        if err != nil {
-               return nil, xerrors.Errorf("error generating connection id: 
%v", err)
+               return nil, fmt.Errorf("error generating connection id: %w", 
err)
        }
 
        info := map[string]string{
diff --git a/dsn.go b/dsn.go
index 32efab9..9dabfb5 100644
--- a/dsn.go
+++ b/dsn.go
@@ -18,12 +18,12 @@
 package avatica
 
 import (
+       "errors"
+       "fmt"
        "net/url"
        "strconv"
        "strings"
        "time"
-
-       "golang.org/x/xerrors"
 )
 
 type authentication int
@@ -73,7 +73,7 @@ func ParseDSN(dsn string) (*Config, error) {
        parsed, err := url.ParseRequestURI(dsn)
 
        if err != nil {
-               return nil, xerrors.Errorf("unable to parse DSN: %v", err)
+               return nil, fmt.Errorf("unable to parse DSN: %w", err)
        }
 
        queries := parsed.Query()
@@ -83,7 +83,7 @@ func ParseDSN(dsn string) (*Config, error) {
                maxRowTotal, err := strconv.Atoi(v)
 
                if err != nil {
-                       return nil, xerrors.Errorf("invalid value for 
maxRowsTotal: %v", err)
+                       return nil, fmt.Errorf("invalid value for maxRowsTotal: 
%w", err)
                }
 
                conf.maxRowsTotal = int64(maxRowTotal)
@@ -94,7 +94,7 @@ func ParseDSN(dsn string) (*Config, error) {
                maxRowTotal, err := strconv.Atoi(v)
 
                if err != nil {
-                       return nil, xerrors.Errorf("invalid value for 
frameMaxSize: %v", err)
+                       return nil, fmt.Errorf("invalid value for frameMaxSize: 
%w", err)
                }
 
                conf.frameMaxSize = int32(maxRowTotal)
@@ -105,7 +105,7 @@ func ParseDSN(dsn string) (*Config, error) {
                loc, err := time.LoadLocation(v)
 
                if err != nil {
-                       return nil, xerrors.Errorf("invalid value for location: 
%v", err)
+                       return nil, fmt.Errorf("invalid value for location: 
%w", err)
                }
 
                conf.location = loc
@@ -116,11 +116,11 @@ func ParseDSN(dsn string) (*Config, error) {
                isolation, err := strconv.Atoi(v)
 
                if err != nil {
-                       return nil, xerrors.Errorf("invalid value for 
transactionIsolation: %v", err)
+                       return nil, fmt.Errorf("invalid value for 
transactionIsolation: %w", err)
                }
 
                if isolation < 0 || isolation > 8 || isolation&(isolation-1) != 
0 {
-                       return nil, xerrors.Errorf("transactionIsolation must 
be 0, 1, 2, 4 or 8, %d given", isolation)
+                       return nil, fmt.Errorf("transactionIsolation must be 0, 
1, 2, 4 or 8, %d given", isolation)
                }
 
                conf.transactionIsolation = uint32(isolation)
@@ -143,7 +143,7 @@ func ParseDSN(dsn string) (*Config, error) {
                } else if auth == "SPNEGO" {
                        conf.authentication = spnego
                } else {
-                       return nil, xerrors.New("authentication must be either 
BASIC, DIGEST or SPNEGO")
+                       return nil, errors.New("authentication must be either 
BASIC, DIGEST or SPNEGO")
                }
 
                if conf.authentication == basic || conf.authentication == 
digest {
@@ -151,7 +151,7 @@ func ParseDSN(dsn string) (*Config, error) {
                        user := queries.Get("avaticaUser")
 
                        if user == "" {
-                               return nil, xerrors.Errorf("authentication is 
set to %s, but avaticaUser is empty", v)
+                               return nil, fmt.Errorf("authentication is set 
to %s, but avaticaUser is empty", v)
                        }
 
                        conf.avaticaUser = user
@@ -159,7 +159,7 @@ func ParseDSN(dsn string) (*Config, error) {
                        pass := queries.Get("avaticaPassword")
 
                        if pass == "" {
-                               return nil, xerrors.Errorf("authentication is 
set to %s, but avaticaPassword is empty", v)
+                               return nil, fmt.Errorf("authentication is set 
to %s, but avaticaPassword is empty", v)
                        }
 
                        conf.avaticaPassword = pass
@@ -174,15 +174,15 @@ func ParseDSN(dsn string) (*Config, error) {
                        krb5CredentialCache := 
queries.Get("krb5CredentialCache")
 
                        if principal == "" && keytab == "" && krb5Conf == "" && 
krb5CredentialCache == "" {
-                               return nil, xerrors.New("when using SPNEGO 
authetication, you must provide the principal, keytab and krb5Conf parameters 
or a krb5TicketCache parameter")
+                               return nil, errors.New("when using SPNEGO 
authetication, you must provide the principal, keytab and krb5Conf parameters 
or a krb5TicketCache parameter")
                        }
 
                        if !((principal != "" && keytab != "" && krb5Conf != 
"") || (principal == "" && keytab == "" && krb5Conf == "")) {
-                               return nil, xerrors.New("when using SPNEGO 
authentication with a principal and keytab, the principal, keytab and krb5Conf 
parameters are required")
+                               return nil, errors.New("when using SPNEGO 
authentication with a principal and keytab, the principal, keytab and krb5Conf 
parameters are required")
                        }
 
                        if (principal != "" || keytab != "" || krb5Conf != "") 
&& krb5CredentialCache != "" {
-                               return nil, xerrors.New("ambigious 
configuration for SPNEGO authentication: use either principal, keytab and 
krb5Conf or krb5TicketCache")
+                               return nil, errors.New("ambigious configuration 
for SPNEGO authentication: use either principal, keytab and krb5Conf or 
krb5TicketCache")
                        }
 
                        if principal != "" {
@@ -190,7 +190,7 @@ func ParseDSN(dsn string) (*Config, error) {
                                splittedPrincipal := strings.Split(principal, 
"@")
 
                                if len(splittedPrincipal) != 2 {
-                                       return nil, xerrors.Errorf("invalid 
kerberos principal (%s): the principal should be in the format 
primary/instance@realm where instance is optional", principal)
+                                       return nil, fmt.Errorf("invalid 
kerberos principal (%s): the principal should be in the format 
primary/instance@realm where instance is optional", principal)
                                }
 
                                conf.principal = krb5Principal{
diff --git a/go.mod b/go.mod
index 156bcdf..626fcbb 100644
--- a/go.mod
+++ b/go.mod
@@ -7,7 +7,6 @@ require (
        github.com/jcmturner/gokrb5/v8 v8.4.2
        github.com/unchartedsoftware/witch v0.0.0-20200617171400-4f405404126f
        github.com/xinsnake/go-http-digest-auth-client v0.6.0
-       golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
        google.golang.org/protobuf v1.28.0
 )
 
diff --git a/http_client.go b/http_client.go
index 97da4df..2d8106b 100644
--- a/http_client.go
+++ b/http_client.go
@@ -30,7 +30,6 @@ import (
        "time"
 
        avaticaMessage "github.com/apache/calcite-avatica-go/v5/message"
-       "golang.org/x/xerrors"
        "google.golang.org/protobuf/proto"
 )
 
@@ -81,7 +80,7 @@ func NewHTTPClient(host string, baseClient *http.Client, 
config *Config) (*httpC
                        realm := config.principal.realm
                        cli, err := WithKerberosAuth(baseClient, user, realm, 
config.keytab, config.krb5Conf, config.krb5CredentialCache)
                        if err != nil {
-                               return nil, xerrors.Errorf("can't add kerberos 
authentication to http client: %v", err)
+                               return nil, fmt.Errorf("can't add kerberos 
authentication to http client: %w", err)
                        }
                        baseClient = cli
                }
@@ -101,7 +100,7 @@ func (c *httpClient) post(ctx context.Context, message 
proto.Message) (proto.Mes
        wrapped, err := proto.Marshal(message)
 
        if err != nil {
-               return nil, xerrors.Errorf("error marshaling request message to 
protobuf: %v", err)
+               return nil, fmt.Errorf("error marshaling request message to 
protobuf: %w", err)
        }
 
        wire := &avaticaMessage.WireMessage{
@@ -112,13 +111,13 @@ func (c *httpClient) post(ctx context.Context, message 
proto.Message) (proto.Mes
        body, err := proto.Marshal(wire)
 
        if err != nil {
-               return nil, xerrors.Errorf("error marshaling wire message to 
protobuf: %v", err)
+               return nil, fmt.Errorf("error marshaling wire message to 
protobuf: %w", err)
        }
 
        req, err := http.NewRequest("POST", c.host, bytes.NewReader(body))
 
        if err != nil {
-               return nil, xerrors.Errorf("error creating http request: %v", 
err)
+               return nil, fmt.Errorf("error creating http request: %w", err)
        }
 
        req.Header.Set("Content-Type", "application/x-google-protobuf")
@@ -128,7 +127,7 @@ func (c *httpClient) post(ctx context.Context, message 
proto.Message) (proto.Mes
        res, err := c.httpClient.Do(req)
 
        if err != nil {
-               return nil, xerrors.Errorf("error executing http request: %v", 
err)
+               return nil, fmt.Errorf("error executing http request: %w", err)
        }
 
        defer res.Body.Close()
@@ -136,7 +135,7 @@ func (c *httpClient) post(ctx context.Context, message 
proto.Message) (proto.Mes
        response, err := ioutil.ReadAll(res.Body)
 
        if err != nil {
-               return nil, xerrors.Errorf("error reading response body: %v", 
err)
+               return nil, fmt.Errorf("error reading response body: %w", err)
        }
 
        result := &avaticaMessage.WireMessage{}
@@ -144,19 +143,19 @@ func (c *httpClient) post(ctx context.Context, message 
proto.Message) (proto.Mes
        err = proto.Unmarshal(response, result)
 
        if err != nil {
-               return nil, xerrors.Errorf("error unmarshaling wire message: 
%v", err)
+               return nil, fmt.Errorf("error unmarshaling wire message: %w", 
err)
        }
 
        inner, err := responseFromClassName(result.Name)
 
        if err != nil {
-               return nil, xerrors.Errorf("error getting wrapped response from 
wire message: %v", err)
+               return nil, fmt.Errorf("error getting wrapped response from 
wire message: %w", err)
        }
 
        err = proto.Unmarshal(result.WrappedMessage, inner)
 
        if err != nil {
-               return nil, xerrors.Errorf("error unmarshaling wrapped message: 
%v", err)
+               return nil, fmt.Errorf("error unmarshaling wrapped message: 
%w", err)
        }
 
        if v, ok := inner.(*avaticaMessage.ErrorResponse); ok {
diff --git a/http_client_wrappers.go b/http_client_wrappers.go
index 5854236..589a87d 100644
--- a/http_client_wrappers.go
+++ b/http_client_wrappers.go
@@ -18,6 +18,7 @@
 package avatica
 
 import (
+       "fmt"
        "net/http"
 
        "github.com/jcmturner/gokrb5/v8/client"
@@ -26,7 +27,6 @@ import (
        "github.com/jcmturner/gokrb5/v8/keytab"
        gokrbSPNEGO "github.com/jcmturner/gokrb5/v8/spnego"
        digest_auth_client "github.com/xinsnake/go-http-digest-auth-client"
-       "golang.org/x/xerrors"
 )
 
 // WithDigestAuth takes an http client and prepares it to authenticate using 
digest authentication
@@ -49,26 +49,26 @@ func WithKerberosAuth(cli *http.Client, username, realm, 
keyTab, krb5Conf, krb5C
        if krb5CredentialCache != "" {
                tc, err := credentials.LoadCCache(krb5CredentialCache)
                if err != nil {
-                       return nil, xerrors.Errorf("error reading kerberos 
ticket cache: %v", err)
+                       return nil, fmt.Errorf("error reading kerberos ticket 
cache: %w", err)
                }
                kc, err := client.NewFromCCache(tc, config.New())
                if err != nil {
-                       return nil, xerrors.Errorf("error creating kerberos 
client: %v", err)
+                       return nil, fmt.Errorf("error creating kerberos client: 
%w", err)
                }
                kerberosClient = kc
        } else {
                cfg, err := config.Load(krb5Conf)
                if err != nil {
-                       return nil, xerrors.Errorf("error reading kerberos 
config: %v", err)
+                       return nil, fmt.Errorf("error reading kerberos config: 
%w", err)
                }
                kt, err := keytab.Load(keyTab)
                if err != nil {
-                       return nil, xerrors.Errorf("error reading kerberos 
keytab: %v", err)
+                       return nil, fmt.Errorf("error reading kerberos keytab: 
%w", err)
                }
                kc := client.NewWithKeytab(username, realm, kt, cfg)
                err = kc.Login()
                if err != nil {
-                       return nil, xerrors.Errorf("error performing kerberos 
login with keytab: %v", err)
+                       return nil, fmt.Errorf("error performing kerberos login 
with keytab: %w", err)
                }
                kerberosClient = kc
        }
@@ -104,7 +104,7 @@ type krb5Transport struct {
 func (t *krb5Transport) RoundTrip(req *http.Request) (resp *http.Response, err 
error) {
        err = gokrbSPNEGO.SetSPNEGOHeader(t.kerberosClient, req, "")
        if err != nil {
-               return nil, xerrors.Errorf("error setting SPNEGO header: %v", 
err)
+               return nil, fmt.Errorf("error setting SPNEGO header: %w", err)
        }
        return t.baseTransport.RoundTrip(req)
 }
diff --git a/result.go b/result.go
index db0b73c..218822c 100644
--- a/result.go
+++ b/result.go
@@ -17,9 +17,7 @@
 
 package avatica
 
-import (
-       "golang.org/x/xerrors"
-)
+import "errors"
 
 type result struct {
        affectedRows int64
@@ -30,7 +28,7 @@ type result struct {
 // after, for example, an INSERT into a table with primary
 // key.
 func (r *result) LastInsertId() (int64, error) {
-       return 0, xerrors.New("use 'SELECT CURRENT VALUE FOR your.sequence' to 
get the last inserted id. For more information, see: 
https://phoenix.apache.org/sequences.html.";)
+       return 0, errors.New("use 'SELECT CURRENT VALUE FOR your.sequence' to 
get the last inserted id. For more information, see: 
https://phoenix.apache.org/sequences.html.";)
 }
 
 // RowsAffected returns the number of rows affected by the
diff --git a/statement.go b/statement.go
index e54421e..b6b7549 100644
--- a/statement.go
+++ b/statement.go
@@ -20,12 +20,12 @@ package avatica
 import (
        "context"
        "database/sql/driver"
+       "errors"
        "math"
        "sync"
        "time"
 
        "github.com/apache/calcite-avatica-go/v5/message"
-       "golang.org/x/xerrors"
 )
 
 type stmt struct {
@@ -129,7 +129,7 @@ func (s *stmt) exec(ctx context.Context, args []namedValue) 
(driver.Result, erro
        results := res.(*message.ExecuteResponse).Results
 
        if len(results) <= 0 {
-               return nil, xerrors.New("empty ResultSet in ExecuteResponse")
+               return nil, errors.New("empty ResultSet in ExecuteResponse")
        }
 
        // Currently there is only 1 ResultSet per response
diff --git a/statement_go18.go b/statement_go18.go
index 0370641..fa5bee6 100644
--- a/statement_go18.go
+++ b/statement_go18.go
@@ -1,3 +1,4 @@
+//go:build go1.8
 // +build go1.8
 
 /*
@@ -22,8 +23,7 @@ package avatica
 import (
        "context"
        "database/sql/driver"
-
-       "golang.org/x/xerrors"
+       "fmt"
 )
 
 func (s *stmt) ExecContext(ctx context.Context, args []driver.NamedValue) 
(driver.Result, error) {
@@ -31,7 +31,7 @@ func (s *stmt) ExecContext(ctx context.Context, args 
[]driver.NamedValue) (drive
        list, err := driverNamedValueToNamedValue(args)
 
        if err != nil {
-               return nil, xerrors.Errorf("error executing statement: %v", err)
+               return nil, fmt.Errorf("error executing statement: %w", err)
        }
 
        return s.exec(ctx, list)
@@ -42,7 +42,7 @@ func (s *stmt) QueryContext(ctx context.Context, args 
[]driver.NamedValue) (driv
        list, err := driverNamedValueToNamedValue(args)
 
        if err != nil {
-               return nil, xerrors.Errorf("error executing query: %v", err)
+               return nil, fmt.Errorf("error executing query: %w", err)
        }
 
        return s.query(ctx, list)

Reply via email to