1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

pretty print json in inspect

This commit is contained in:
Victor Vieux 2013-05-09 03:46:39 +02:00
parent fc29f01528
commit 842cb8909e

View file

@ -457,7 +457,14 @@ func CmdInspect(args ...string) error {
return err
}
}
fmt.Printf("%s\n", obj)
indented := new(bytes.Buffer)
if err = json.Indent(indented, obj, "", " "); err != nil {
return err
}
if _, err := io.Copy(os.Stdout, indented); err != nil {
return err
}
return nil
}