fix inspect when it returns nothing valid

This commit is contained in:
Victor Vieux 2013-10-31 18:39:44 -07:00
Родитель e3c49843d7
Коммит 40ed10cc32
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -667,9 +667,11 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
}
indented.WriteString(",")
}
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