From 463e5ccfcb2db2b32a28551345a4ecca0d1046ef Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Wed, 7 Oct 2026 16:34:34 -0700 Subject: [PATCH] Use strings.CutLast in cutLast golangci-lint's modernize check now flags the hand-rolled LastIndex, which fails CI on main and blocks the release workflow. --- internal/docker/helpers.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/docker/helpers.go b/internal/docker/helpers.go index 360a82b..ea8104f 100644 --- a/internal/docker/helpers.go +++ b/internal/docker/helpers.go @@ -40,9 +40,5 @@ func randomID(length int) (string, error) { // cutLast splits s around the last occurrence of sep, like strings.Cut but // from the right. func cutLast(s, sep string) (before, after string, found bool) { - i := strings.LastIndex(s, sep) - if i < 0 { - return s, "", false - } - return s[:i], s[i+len(sep):], true + return strings.CutLast(s, sep) }