mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-22 05:56:17 +00:00
fix inspect when it returns nothing valid
This commit is contained in:
+4
-2
@@ -667,9 +667,11 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
|
||||
}
|
||||
indented.WriteString(",")
|
||||
}
|
||||
// Remove trailling ','
|
||||
indented.Truncate(indented.Len() - 1)
|
||||
|
||||
if indented.Len() > 0 {
|
||||
// Remove trailling ','
|
||||
indented.Truncate(indented.Len() - 1)
|
||||
}
|
||||
fmt.Fprintf(cli.out, "[")
|
||||
if _, err := io.Copy(cli.out, indented); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user