From 1b1b11d0a0d33e8b1c5d532303c92f7795e2d2db Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Thu, 14 Nov 2019 14:23:17 -0700 Subject: [PATCH] Release v0.3.2 Signed-off-by: Ivan Kozlovic --- .travis.yml | 5 +++-- go.mod | 2 +- go.sum | 4 ++-- types_test.go | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f7dc924..50e27a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: go sudo: false go: +- 1.13.x - 1.12.x -- 1.11.x install: - go get -t ./... @@ -18,4 +18,5 @@ before_script: - staticcheck ./... script: -- if [[ "$TRAVIS_GO_VERSION" == 1.10.* ]] ; then ./scripts/cov.sh TRAVIS; else go test -v -race ./...; fi +- go test -v -race ./... +- if [[ "$TRAVIS_GO_VERSION" =~ 1.12 ]]; then ./scripts/cov.sh TRAVIS; fi diff --git a/go.mod b/go.mod index b1ad180..a780dde 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/nats-io/jwt -require github.com/nats-io/nkeys v0.1.0 +require github.com/nats-io/nkeys v0.1.3 diff --git a/go.sum b/go.sum index ea493ec..9baf67f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/nats-io/nkeys v0.1.0 h1:qMd4+pRHgdr1nAClu+2h/2a5F2TmKcCzjCDazVgRoX4= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3 h1:6JrEfig+HzTH85yxzhSVbjHRJv9cn0p6n3IngIcM5/k= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/types_test.go b/types_test.go index 5469bb1..4315c16 100644 --- a/types_test.go +++ b/types_test.go @@ -16,6 +16,7 @@ package jwt import ( + "os" "regexp" "strings" "testing" @@ -29,6 +30,23 @@ func TestVersion(t *testing.T) { } } +func TestVersionMatchesTag(t *testing.T) { + tag := os.Getenv("TRAVIS_TAG") + if tag == "" { + t.SkipNow() + } + // We expect a tag of the form vX.Y.Z. If that's not the case, + // we need someone to have a look. So fail if first letter is not + // a `v` + if tag[0] != 'v' { + t.Fatalf("Expect tag to start with `v`, tag is: %s", tag) + } + // Strip the `v` from the tag for the version comparison. + if Version != tag[1:] { + t.Fatalf("Version (%s) does not match tag (%s)", Version, tag[1:]) + } +} + func TestTimeRangeValidation(t *testing.T) { tr := TimeRange{ Start: "hello",