Skip to content

Commit

Permalink
chore: remove uses of obsolete golang.org/x/xerrors (#1776)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thaJeztah authored Dec 8, 2022
1 parent 37a2e41 commit 6193507
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
7 changes: 3 additions & 4 deletions internal/gensupport/send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ package gensupport

import (
"context"
"errors"
"net/http"
"testing"

"golang.org/x/xerrors"
)

func TestSendRequest(t *testing.T) {
Expand All @@ -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) {
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 6193507

Please sign in to comment.