Merge pull request #16415 from HuKeping/dockerinfo

Format output of docker info
Upstream-commit: 40e856041265d6030768286f1b228f042c0f768b
Component: engine
This commit is contained in:
Brian Goff
2015-09-23 21:15:23 -04:00
4 changed files with 57 additions and 42 deletions

View File

@ -12,3 +12,11 @@ func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) {
}
return 0, nil
}
// FprintfIfTrue prints the boolean value if it's true
func FprintfIfTrue(w io.Writer, format string, ok bool) (int, error) {
if ok {
return fmt.Fprintf(w, format, ok)
}
return 0, nil
}