Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supported Go versions 1.18 or later #171

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
16 changes: 5 additions & 11 deletions amazon/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"os"
"reflect"
"testing"
Expand Down Expand Up @@ -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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
}
}

Expand Down
19 changes: 14 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
)