diff --git a/.github/env b/.github/env index 9d79b174f..d7d626f43 100644 --- a/.github/env +++ b/.github/env @@ -1,2 +1,2 @@ GOLANG_VERSION=1.25 -GOLANGCI_LINT_VERSION=v2.5.0 +GOLANGCI_LINT_VERSION=v2.8.0 diff --git a/.golangci.yml b/.golangci.yml index 7eca135e5..f3a0c6302 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,12 +18,15 @@ linters: default: none enable: + # Please keep this list in alphabetic order - depguard - dupl + - exhaustive - gomodguard - govet - ineffassign - misspell + - modernize - nakedret - revive - sloglint @@ -32,7 +35,6 @@ linters: - unused - usestdlibvars - usetesting - - exhaustive exclusions: diff --git a/pkg/downloader/chart_downloader.go b/pkg/downloader/chart_downloader.go index d21a79335..9c26f925e 100644 --- a/pkg/downloader/chart_downloader.go +++ b/pkg/downloader/chart_downloader.go @@ -597,8 +597,8 @@ func loadRepoConfig(file string) (*repo.File, error) { // stripDigestAlgorithm removes the algorithm prefix (e.g., "sha256:") from a digest string. // If no prefix is present, the original string is returned unchanged. func stripDigestAlgorithm(digest string) string { - if idx := strings.Index(digest, ":"); idx >= 0 { - return digest[idx+1:] + if _, after, ok := strings.Cut(digest, ":"); ok { + return after } return digest }