github.com/slene/docker@v1.8.0-rc1/pkg/ioutils/fmt.go (about)

     1  package ioutils
     2  
     3  import (
     4  	"fmt"
     5  	"io"
     6  )
     7  
     8  // FprintfIfNotEmpty prints the string value if it's not empty
     9  func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) {
    10  	if value != "" {
    11  		return fmt.Fprintf(w, format, value)
    12  	}
    13  	return 0, nil
    14  }