*: 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:
@@ -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"
|
||||
|
@@ -92,7 +92,6 @@ func (s *Server) startKeyRotation(ctx context.Context, strategy rotationStrategy
|
||||
}
|
||||
}
|
||||
}()
|
||||
return
|
||||
}
|
||||
|
||||
func (k keyRotater) rotate() error {
|
||||
|
@@ -426,7 +426,6 @@ func (s *Server) startGarbageCollection(ctx context.Context, frequency time.Dura
|
||||
}
|
||||
}
|
||||
}()
|
||||
return
|
||||
}
|
||||
|
||||
// ConnectorConfig is a configuration that can open a connector.
|
||||
|
@@ -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.")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user