Skip to content

Commit be6f4cd

Browse files
committed
cli/command/system: prettyPrintServerInfo: refactor printing "runtimes"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 1d70f7c commit be6f4cd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cli/command/system/info.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ func prettyPrintServerInfo(dockerCli command.Cli, info *info) []error {
253253
printSwarmInfo(dockerCli, *info.Info)
254254

255255
if len(info.Runtimes) > 0 {
256-
fmt.Fprint(dockerCli.Out(), " Runtimes:")
256+
names := make([]string, 0, len(info.Runtimes))
257257
for name := range info.Runtimes {
258-
fmt.Fprintf(dockerCli.Out(), " %s", name)
258+
names = append(names, name)
259259
}
260-
fmt.Fprint(dockerCli.Out(), "\n")
260+
fmt.Fprintln(dockerCli.Out(), " Runtimes:", strings.Join(names, " "))
261261
fmt.Fprintln(dockerCli.Out(), " Default Runtime:", info.DefaultRuntime)
262262
}
263263

0 commit comments

Comments
 (0)