mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix inspect when it returns nothing valid
This commit is contained in:
parent
e3c49843d7
commit
40ed10cc32
1 changed files with 4 additions and 2 deletions
|
@ -667,9 +667,11 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
|
||||||
}
|
}
|
||||||
indented.WriteString(",")
|
indented.WriteString(",")
|
||||||
}
|
}
|
||||||
// Remove trailling ','
|
|
||||||
indented.Truncate(indented.Len() - 1)
|
|
||||||
|
|
||||||
|
if indented.Len() > 0 {
|
||||||
|
// Remove trailling ','
|
||||||
|
indented.Truncate(indented.Len() - 1)
|
||||||
|
}
|
||||||
fmt.Fprintf(cli.out, "[")
|
fmt.Fprintf(cli.out, "[")
|
||||||
if _, err := io.Copy(cli.out, indented); err != nil {
|
if _, err := io.Copy(cli.out, indented); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue