mirror of
https://github.com/docker/docs.git
synced 2026-04-12 06:19:22 +07:00
15 lines
255 B
Go
15 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
|
|
}
|