From 6193507246bdb77dfc431d552c3c88585de314fe Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 8 Dec 2022 16:26:17 +0100 Subject: [PATCH] chore: remove uses of obsolete golang.org/x/xerrors (#1776) go1.13 and up now provide this functionality, and the xerrors.Is() function was deprecated. Removing the dependency, as it was only used in a test. --- go.mod | 1 - go.sum | 2 -- internal/gensupport/send_test.go | 7 +++---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 968042ee8da..d64df798c76 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,6 @@ require ( golang.org/x/net v0.0.0-20221014081412-f15817d10f9b golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 golang.org/x/sync v0.1.0 - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 google.golang.org/appengine v1.6.7 google.golang.org/genproto v0.0.0-20221206210731-b1a01be3a5f6 google.golang.org/grpc v1.51.0 diff --git a/go.sum b/go.sum index ffe56d9dc21..3387e76c043 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= diff --git a/internal/gensupport/send_test.go b/internal/gensupport/send_test.go index b4ce4cfde2f..bdc074c81af 100644 --- a/internal/gensupport/send_test.go +++ b/internal/gensupport/send_test.go @@ -6,10 +6,9 @@ package gensupport import ( "context" + "errors" "net/http" "testing" - - "golang.org/x/xerrors" ) func TestSendRequest(t *testing.T) { @@ -35,7 +34,7 @@ func TestSendRequestWithRetry(t *testing.T) { type brokenRoundTripper struct{} func (t *brokenRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { - return nil, xerrors.New("this should not happen") + return nil, errors.New("this should not happen") } func TestCanceledContextDoesNotPerformRequest(t *testing.T) { @@ -47,7 +46,7 @@ func TestCanceledContextDoesNotPerformRequest(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) cancel() _, err := SendRequestWithRetry(ctx, &client, req, nil) - if !xerrors.Is(err, context.Canceled) { + if !errors.Is(err, context.Canceled) { t.Fatalf("got %v, want %v", err, context.Canceled) } }