a8436a9c51
Signed-off-by: Victor Vieux <victorvieux@gmail.com> Upstream-commit: c790aa36ea92799593fe4b32fc516784eb0c2c43 Component: engine
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
|
|
}
|