Bump golangci-lint to 1.61.0

This commit is contained in:
Joshua Casey
2024-09-10 15:14:53 -05:00
parent 8ee08050cc
commit 702d5bdc01
6 changed files with 5 additions and 6 deletions

View File

@@ -43,7 +43,7 @@ linters:
- whitespace - whitespace
- copyloopvar - copyloopvar
- intrange - intrange
- fatcontext # - fatcontext Starting in go@1.23.1 and golangci-lint@1.61.0 this gave a lot of false positives
# - canonicalheader Can't do this one since it alerts on valid headers such as X-XSS-Protection # - canonicalheader Can't do this one since it alerts on valid headers such as X-XSS-Protection
- spancheck - spancheck
- importas - importas

View File

@@ -1 +1 @@
1.60.3 1.61.0

View File

@@ -40,7 +40,6 @@ func getWarningHandler() rest.WarningHandler {
// the client-go rest.WarningHandlers all log warnings with non-empty message and code=299, agent is ignored // the client-go rest.WarningHandlers all log warnings with non-empty message and code=299, agent is ignored
// no deduplication or color output when running from a non-terminal such as a pod // no deduplication or color output when running from a non-terminal such as a pod
//nolint:gosec // this is an int, cast to uintptr, cast back to int
if isTerm := term.IsTerminal(int(os.Stderr.Fd())); !isTerm { if isTerm := term.IsTerminal(int(os.Stderr.Fd())); !isTerm {
return rest.WarningLogger{} return rest.WarningLogger{}
} }

View File

@@ -1461,7 +1461,7 @@ func forceUserInfoWithClaims(subject string, claims string) *coreosoidc.UserInfo
// this is some dark magic to set a private field // this is some dark magic to set a private field
claimsField := reflect.ValueOf(userInfo).Elem().FieldByName("claims") claimsField := reflect.ValueOf(userInfo).Elem().FieldByName("claims")
claimsPointer := (*[]byte)(unsafe.Pointer(claimsField.UnsafeAddr())) //nolint:gosec // this is a test hack we are willing to live with claimsPointer := (*[]byte)(unsafe.Pointer(claimsField.UnsafeAddr()))
*claimsPointer = []byte(claims) *claimsPointer = []byte(claims)
return userInfo return userInfo

View File

@@ -75,7 +75,7 @@ const (
) )
// stdin returns the file descriptor for stdin as an int. // stdin returns the file descriptor for stdin as an int.
func stdin() int { return int(os.Stdin.Fd()) } //nolint:gosec // this is an int, cast to uintptr, cast back to int func stdin() int { return int(os.Stdin.Fd()) }
type handlerState struct { type handlerState struct {
// Basic parameters. // Basic parameters.

View File

@@ -28,7 +28,7 @@ func TestMain(m *testing.M) {
func splitIntegrationTestsIntoBuckets(m *testing.M) { func splitIntegrationTestsIntoBuckets(m *testing.M) {
// this is some dark magic to set a private field // this is some dark magic to set a private field
testsField := reflect.ValueOf(m).Elem().FieldByName("tests") testsField := reflect.ValueOf(m).Elem().FieldByName("tests")
testsPointer := (*[]testing.InternalTest)(unsafe.Pointer(testsField.UnsafeAddr())) //nolint:gosec // this is a test hack we are willing to live with testsPointer := (*[]testing.InternalTest)(unsafe.Pointer(testsField.UnsafeAddr()))
tests := *testsPointer tests := *testsPointer