From e58d3b75485401073a004dd9858860f8a5d9f627 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Tue, 1 Nov 2016 09:52:33 -0700 Subject: [PATCH] Remove unreachable code `go vet` on Go 1.8 errors because this line of code is unreachable. Adds a check that new code passes go vet, and adds Go 1.7 to travisci. --- .travis.yml | 5 +++++ errors.go | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index bde823d..1027f56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,13 @@ language: go +script: + - go vet ./... + - go test -v ./... + go: - 1.3 - 1.4 - 1.5 - 1.6 + - 1.7 - tip diff --git a/errors.go b/errors.go index 662df19..1c93024 100644 --- a/errors.go +++ b/errors.go @@ -51,13 +51,9 @@ func (e ValidationError) Error() string { } else { return "token is invalid" } - return e.Inner.Error() } // No errors func (e *ValidationError) valid() bool { - if e.Errors > 0 { - return false - } - return true + return e.Errors == 0 }