printInfoRow renders a "label: value" row when value is non-empty; no-op otherwise. Centralizes the prefix/colorize/i18n boilerplate.
(labelKey, value, labelColor string)
| 796 | // printInfoRow renders a "label: value" row when value is non-empty; no-op |
| 797 | // otherwise. Centralizes the prefix/colorize/i18n boilerplate. |
| 798 | func printInfoRow(labelKey, value, labelColor string) { |
| 799 | if value == "" { |
| 800 | return |
| 801 | } |
| 802 | fmt.Printf(" %s %s\n", colorize(i18n.T(labelKey)+":", labelColor), value) |
| 803 | } |
| 804 | |
| 805 | // pickFirstNonEmpty returns the first non-empty string from its arguments, |
| 806 | // or "" when every argument is empty. Lets row helpers express |
no test coverage detected