*: 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

View File

@@ -89,6 +89,7 @@ func tokenErr(w http.ResponseWriter, typ, description string, statusCode int) er
return nil
}
// nolint
const (
errInvalidRequest = "invalid_request"
errUnauthorizedClient = "unauthorized_client"

View File

@@ -92,7 +92,6 @@ func (s *Server) startKeyRotation(ctx context.Context, strategy rotationStrategy
}
}
}()
return
}
func (k keyRotater) rotate() error {

View File

@@ -426,7 +426,6 @@ func (s *Server) startGarbageCollection(ctx context.Context, frequency time.Dura
}
}
}()
return
}
// ConnectorConfig is a configuration that can open a connector.

View File

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