Skip to content

Commit

Permalink
update golangci-lint to v1.61.0 (#1327)
Browse files Browse the repository at this point in the history
* chore(linter): update golangci-lint to v1.61.0

* chore(linter): fix findings
  • Loading branch information
lburgazzoli authored Oct 31, 2024
1 parent 8ea9ea0 commit 87c87ab
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.2
version: v1.61.0
args: --timeout 5m0s
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ YQ ?= $(LOCALBIN)/yq
KUSTOMIZE_VERSION ?= v5.0.2
CONTROLLER_GEN_VERSION ?= v0.16.1
OPERATOR_SDK_VERSION ?= v1.31.0
GOLANGCI_LINT_VERSION ?= v1.60.2
GOLANGCI_LINT_VERSION ?= v1.61.0
YQ_VERSION ?= v4.12.2
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.31.0
Expand Down
1 change: 1 addition & 0 deletions controllers/dscinitialization/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func TestDataScienceClusterInitialization(t *testing.T) {

var testScheme = runtime.NewScheme()

//nolint:fatcontext
var _ = BeforeSuite(func() {
// can't use suite's context as the manager should survive the function
gCtx, gCancel = context.WithCancel(context.Background())
Expand Down
1 change: 1 addition & 0 deletions controllers/webhook/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func TestAPIs(t *testing.T) {
RunSpecs(t, "Webhook Suite")
}

//nolint:fatcontext
var _ = BeforeSuite(func() {
// can't use suite's context as the manager should survive the function
gCtx, gCancel = context.WithCancel(context.Background())
Expand Down
6 changes: 3 additions & 3 deletions pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func stringToLevel(flagValue string) (zapcore.Level, error) {
if validLevel {
return level, nil
}
logLevel, err := strconv.Atoi(flagValue)
logLevel, err := strconv.ParseInt(flagValue, 10, 8)
if err != nil {
return 0, fmt.Errorf("invalid log level \"%s\"", flagValue)
}
if logLevel > 0 {
intLevel := -1 * logLevel
return zapcore.Level(int8(intLevel)), nil
intLevel := -1 * int8(logLevel)
return zapcore.Level(intLevel), nil
}

return 0, fmt.Errorf("invalid log level \"%s\"", flagValue)
Expand Down

0 comments on commit 87c87ab

Please sign in to comment.