From beeb997817b85b7d93f5490f9e0bb5c6e7a1682f Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Wed, 25 Feb 2026 08:29:24 +0100 Subject: [PATCH] chore: enable the modernize linter Signed-off-by: Mads Jensen --- .github/env | 2 +- .golangci.yml | 4 +++- pkg/downloader/chart_downloader.go | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) 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 }