From b0201c8531d2a1af66c1d52e02eeea571a941730 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 1 Oct 2025 01:57:59 +0200 Subject: [PATCH] cmd/docker: hideUnsupportedFeatures: remove unused error return ``` 70.72 cmd/docker/docker.go:560:74: hideUnsupportedFeatures - result 0 (error) is always nil (unparam) 70.72 func hideUnsupportedFeatures(cmd *cobra.Command, details versionDetails) error { 70.72 ^ 70.72 1 issues: ``` Signed-off-by: Sebastiaan van Stijn --- cmd/docker/docker.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/docker/docker.go b/cmd/docker/docker.go index d1e056b9f..9846dc3f7 100644 --- a/cmd/docker/docker.go +++ b/cmd/docker/docker.go @@ -254,10 +254,7 @@ func setHelpFunc(dockerCli command.Cli, cmd *cobra.Command) { ccmd.Println(err) return } - if err := hideUnsupportedFeatures(ccmd, dockerCli); err != nil { - ccmd.Println(err) - return - } + hideUnsupportedFeatures(ccmd, dockerCli) defaultHelpFunc(ccmd, args) }) @@ -557,7 +554,7 @@ func hideSubcommandIf(subcmd *cobra.Command, condition func(string) bool, annota } } -func hideUnsupportedFeatures(cmd *cobra.Command, details versionDetails) error { +func hideUnsupportedFeatures(cmd *cobra.Command, details versionDetails) { var ( notExperimental = func(_ string) bool { return !details.ServerInfo().HasExperimental } notOSType = func(v string) bool { return details.ServerInfo().OSType != "" && v != details.ServerInfo().OSType } @@ -613,7 +610,6 @@ func hideUnsupportedFeatures(cmd *cobra.Command, details versionDetails) error { hideSubcommandIf(subcmd, notSwarmStatus, "swarm") hideSubcommandIf(subcmd, versionOlderThan, "version") } - return nil } // Checks if a command or one of its ancestors is in the list