cli/command/system: prettyPrintServerInfo: refactor printing "runtimes"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-05-02 16:05:52 +02:00
parent 1d70f7cdb4
commit be6f4cd56c
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 3 additions and 3 deletions

View File

@ -253,11 +253,11 @@ func prettyPrintServerInfo(dockerCli command.Cli, info *info) []error {
printSwarmInfo(dockerCli, *info.Info) printSwarmInfo(dockerCli, *info.Info)
if len(info.Runtimes) > 0 { if len(info.Runtimes) > 0 {
fmt.Fprint(dockerCli.Out(), " Runtimes:") names := make([]string, 0, len(info.Runtimes))
for name := range info.Runtimes { for name := range info.Runtimes {
fmt.Fprintf(dockerCli.Out(), " %s", name) names = append(names, name)
} }
fmt.Fprint(dockerCli.Out(), "\n") fmt.Fprintln(dockerCli.Out(), " Runtimes:", strings.Join(names, " "))
fmt.Fprintln(dockerCli.Out(), " Default Runtime:", info.DefaultRuntime) fmt.Fprintln(dockerCli.Out(), " Default Runtime:", info.DefaultRuntime)
} }