Format output of docker info

Format those info which will only be displayed when daemon is
in debug mode.

Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
Hu Keping
2015-09-23 14:35:13 +08:00
parent b0dc11127e
commit 141e91c480
4 changed files with 57 additions and 42 deletions
+8
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
}