From 2875e480249be07ae0c2b160731a476fa4d52cec Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 11 Feb 2026 13:16:13 +0100 Subject: [PATCH] modernize: stringscut go install golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest modernize -stringscut -fix ./... Signed-off-by: Sebastiaan van Stijn --- cli/command/telemetry_utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/command/telemetry_utils.go b/cli/command/telemetry_utils.go index dadbd13fd7..179177c02b 100644 --- a/cli/command/telemetry_utils.go +++ b/cli/command/telemetry_utils.go @@ -155,11 +155,11 @@ func (e statusError) Error() string { // Note: The root command's name is excluded. If cmd is the root cmd, return "" func getCommandName(cmd *cobra.Command) string { fullCmdName := getFullCommandName(cmd) - i := strings.Index(fullCmdName, " ") - if i == -1 { + _, after, ok := strings.Cut(fullCmdName, " ") + if !ok { return "" } - return fullCmdName[i+1:] + return after } // getFullCommandName gets the full cobra command name in the format