DisplayTextWithFlavor translates the template, bolds and adds cyan color to 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{})
| 275 | // templateValues, substitutes templateValues into the template, and outputs |
| 276 | // the result to ui.Out. Only the first map in templateValues is used. |
| 277 | func (ui *UI) DisplayTextWithFlavor(template string, templateValues ...map[string]interface{}) { |
| 278 | ui.terminalLock.Lock() |
| 279 | defer ui.terminalLock.Unlock() |
| 280 | |
| 281 | firstTemplateValues := getFirstSet(templateValues) |
| 282 | for key, value := range firstTemplateValues { |
| 283 | firstTemplateValues[key] = ui.modifyColor(fmt.Sprint(value), color.New(color.FgCyan, color.Bold)) |
| 284 | } |
| 285 | fmt.Fprintf(ui.Out, "%s\n", ui.TranslateText(template, firstTemplateValues)) |
| 286 | } |
| 287 | |
| 288 | func getIndent(depth int, addHyphen bool) string { |
| 289 | if depth == 0 { |
nothing calls this directly
no test coverage detected