mirror of
https://github.com/docker/cli.git
synced 2026-11-01 23:35:23 +03:00
modernize: stringscut
go install golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest
modernize -stringscut -fix ./...
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user