github.com/cloudfoundry/cli@v7.1.0+incompatible/util/ui/ui_v7.go (about)

     1  package ui
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // DisplayWarning translates the warning, substitutes in templateValues, and
     8  // outputs to ui.Err. Only the first map in templateValues is used.
     9  // This command has one fewer newline than DisplayWarning. Use it before an OK message in V7.
    10  func (ui *UI) DisplayWarning(template string, templateValues ...map[string]interface{}) {
    11  	fmt.Fprintf(ui.Err, "%s\n", ui.TranslateText(template, templateValues...))
    12  }
    13  
    14  // Translates warnings and outputs them to ui.Err.
    15  // Prints each warning with a trailing newline.
    16  func (ui *UI) DisplayWarnings(warnings []string) {
    17  	for _, warning := range warnings {
    18  		fmt.Fprintf(ui.Err, "%s\n", ui.TranslateText(warning))
    19  	}
    20  }