From 61d9e7ac67737f6b874a49604e30aaead8906825 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Thu, 15 Oct 2026 18:51:09 +0300 Subject: [PATCH] ci: bump golangci-lint to v2.14.0 Lint fails on every pull request since the `stable` Go of setup-go moved from 1.27.1 to 1.27.2. golangci-lint v2.13.2 cannot read the export data Go 1.27.2 writes for the standard library ("export data version 5 is greater than maximum supported version 4"), so typecheck fails on the first import of testing or bytes. v2.14.0 reads it. v2.14.0 also adds the modernize stringscut check, which flags the one strings.LastIndex in the image tag parser; it now uses strings.CutLast. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin --- .github/workflows/pr.yml | 2 +- pkg/commands/preflight_upgrade_verify.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2ff76a6d..e0c259ca 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -43,7 +43,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v7 with: - version: v2.13.2 + version: v2.14.0 args: --timeout=10m dco: diff --git a/pkg/commands/preflight_upgrade_verify.go b/pkg/commands/preflight_upgrade_verify.go index a9e76c92..4e2b4adb 100644 --- a/pkg/commands/preflight_upgrade_verify.go +++ b/pkg/commands/preflight_upgrade_verify.go @@ -149,11 +149,9 @@ func parseTargetVersion(image string) string { // suffix after `:`. Splitting on `/` first isolates that // component, so a registry port (`registry.local:5000`) in an // earlier path component cannot be mistaken for a tag separator. - lastSlash := strings.LastIndex(image, "/") - tail := image - if lastSlash >= 0 { - tail = image[lastSlash+1:] + if _, after, found := strings.CutLast(image, "/"); found { + tail = after } idx := strings.LastIndex(tail, ":")