Skip to content

Commit

Permalink
Bump golangci-lint to 1.61.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatcasey committed Sep 10, 2024
1 parent 8ee0805 commit 702d5bd
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ linters:
- whitespace
- copyloopvar
- 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
- spancheck
- importas
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/lint-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.60.3
1.61.0
1 change: 0 additions & 1 deletion internal/net/phttp/warning.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

// 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 {
return rest.WarningLogger{}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/upstreamoidc/upstreamoidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ func forceUserInfoWithClaims(subject string, claims string) *coreosoidc.UserInfo

// this is some dark magic to set a private field
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)

return userInfo
Expand Down
2 changes: 1 addition & 1 deletion pkg/oidcclient/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const (
)

// 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()) }

Check warning on line 78 in pkg/oidcclient/login.go

View check run for this annotation

Codecov / codecov/patch

pkg/oidcclient/login.go#L78

Added line #L78 was not covered by tests

type handlerState struct {
// Basic parameters.
Expand Down
2 changes: 1 addition & 1 deletion test/integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestMain(m *testing.M) {
func splitIntegrationTestsIntoBuckets(m *testing.M) {
// this is some dark magic to set a private field
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

Expand Down

0 comments on commit 702d5bd

Please sign in to comment.