1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg/ioutils/fmt.go
Victor Vieux c790aa36ea no not print empty keys in docker info
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-06-01 15:05:20 -07:00

14 lines
255 B
Go

package ioutils
import (
"fmt"
"io"
)
// FprintfIfNotEmpty prints the string value if it's not empty
func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) {
if value != "" {
return fmt.Fprintf(w, format, value)
}
return 0, nil
}