*: fix some lint issues

Mostly gathered these using golangci-lint's deadcode and ineffassign
linters.

Signed-off-by: Stephan Renatus <srenatus@chef.io>
This commit is contained in:
Stephan Renatus
2019-07-30 11:08:57 +02:00
parent 72f5596671
commit d9487e553b
13 changed files with 12 additions and 60 deletions

@@ -552,7 +552,6 @@ func TestOAuth2CodeFlow(t *testing.T) {
t.Errorf("state did not match, want=%q got=%q", state, gotState)
}
w.WriteHeader(http.StatusOK)
return
}))
defer oauth2Client.Close()
@@ -1204,7 +1203,6 @@ func TestRefreshTokenFlow(t *testing.T) {
t.Errorf("state did not match, want=%q got=%q", state, gotState)
}
w.WriteHeader(http.StatusOK)
return
}))
defer oauth2Client.server.Close()
@@ -1242,8 +1240,7 @@ func TestRefreshTokenFlow(t *testing.T) {
}
// try to refresh expired token with old refresh token.
newToken, err := oauth2Client.config.TokenSource(ctx, tok).Token()
if newToken != nil {
t.Errorf("Token refreshed with invalid refresh token.")
if _, err := oauth2Client.config.TokenSource(ctx, tok).Token(); err == nil {
t.Errorf("Token refreshed with invalid refresh token, error expected.")
}
}