Explorar o código

Add comment about inspect output

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Qiang Huang %!s(int64=10) %!d(string=hai) anos
pai
achega
01a9a9284f
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      api/client/inspect.go

+ 3 - 0
api/client/inspect.go

@@ -109,6 +109,9 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
 	indented.WriteString("]\n")
 
 	if tmpl == nil {
+		// Note that we will always write "[]" when "-f" isn't specified,
+		// to make sure the output would always be array, see
+		// https://github.com/docker/docker/pull/9500#issuecomment-65846734
 		if _, err := io.Copy(cli.out, indented); err != nil {
 			return err
 		}