MCPcopy Index your code
hub / github.com/cloudfoundry/cli / DisplayTextWithBold

Method DisplayTextWithBold

util/ui/ui.go:263–272  ·  view source on GitHub ↗

DisplayTextWithBold translates the template, bolds the templateValues, substitutes templateValues into the template, and outputs the result to ui.Out. Only the first map in templateValues is used.

(template string, templateValues ...map[string]interface{})

Source from the content-addressed store, hash-verified

261// substitutes templateValues into the template, and outputs
262// the result to ui.Out. Only the first map in templateValues is used.
263func (ui *UI) DisplayTextWithBold(template string, templateValues ...map[string]interface{}) {
264 ui.terminalLock.Lock()
265 defer ui.terminalLock.Unlock()
266
267 firstTemplateValues := getFirstSet(templateValues)
268 for key, value := range firstTemplateValues {
269 firstTemplateValues[key] = ui.modifyColor(fmt.Sprint(value), color.New(color.Bold))
270 }
271 fmt.Fprintf(ui.Out, "%s\n", ui.TranslateText(template, firstTemplateValues))
272}
273
274// DisplayTextWithFlavor translates the template, bolds and adds cyan color to
275// templateValues, substitutes templateValues into the template, and outputs

Callers

nothing calls this directly

Calls 3

modifyColorMethod · 0.95
TranslateTextMethod · 0.95
getFirstSetFunction · 0.85

Tested by

no test coverage detected