Pārlūkot izejas kodu

Merge pull request #13696 from hqhq/hq_add_comment_inspect

Add comment about inspect output
Antonio Murdaca 10 gadi atpakaļ
vecāks
revīzija
f03daf29dc
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  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")
 	indented.WriteString("]\n")
 
 
 	if tmpl == nil {
 	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 {
 		if _, err := io.Copy(cli.out, indented); err != nil {
 			return err
 			return err
 		}
 		}