diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index eb36d76..cbadf39 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.15', '1.16', '1.17' ] + go: [ '1.18', '1.19' ] name: Go ${{ matrix.go }} test steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 3026435..1512a29 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ go-iap ====== -![](https://img.shields.io/badge/golang-1.15+-blue.svg?style=flat) +![](https://img.shields.io/badge/golang-1.18+-blue.svg?style=flat) [![Build Status](https://travis-ci.org/awa/go-iap.svg?branch=master)](https://travis-ci.org/awa/go-iap) [![codecov.io](https://codecov.io/github/awa/go-iap/coverage.svg?branch=master)](https://codecov.io/github/awa/go-iap?branch=master) diff --git a/amazon/validator_test.go b/amazon/validator_test.go index d5d2b0c..ea9c216 100644 --- a/amazon/validator_test.go +++ b/amazon/validator_test.go @@ -6,7 +6,6 @@ import ( "fmt" "net/http" "net/http/httptest" - "net/url" "os" "reflect" "testing" @@ -169,21 +168,16 @@ func TestVerifyEntitled(t *testing.T) { func TestVerifyTimeout(t *testing.T) { t.Parallel() - // HTTP 100 is "continue" so it will time out - server, client := testTools(100, "timeout response") + server, client := testTools(http.StatusGatewayTimeout, "{\"message\": \"timeout response\"}") defer server.Close() ctx := context.Background() _, actual := client.Verify(ctx, "timeout", "timeout") - - // Actual should be a "request canceled" *url.Error - urlErr, ok := actual.(*url.Error) - if !ok { - t.Errorf("Expected *url.Error, got %T", actual) + if actual == nil { + t.Error("expected error, got nil") } - - if !urlErr.Timeout() { - t.Errorf("got %v\nwant timeout", actual) + if actual.Error() != "timeout response" { + t.Errorf("got %v\nwant %v", actual, "timeout response") } } diff --git a/go.mod b/go.mod index eaf74fc..abba7ef 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,26 @@ module github.com/awa/go-iap -go 1.15 +go 1.18 require ( github.com/golang-jwt/jwt/v4 v4.3.0 - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.5.0 github.com/google/uuid v1.3.0 - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect - golang.org/x/text v0.3.7 // indirect google.golang.org/api v0.48.0 google.golang.org/appengine v1.6.7 +) + +require ( + cloud.google.com/go v0.83.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/googleapis/gax-go/v2 v2.0.5 // indirect + go.opencensus.io v0.23.0 // indirect + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20210607140030-00d4fb20b1ae // indirect + google.golang.org/grpc v1.38.0 // indirect + google.golang.org/protobuf v1.26.0 // indirect )