label returns a string containing the label with indentation and padding.
(l string, indent, width int)
| 553 | |
| 554 | // label returns a string containing the label with indentation and padding. |
| 555 | func label(l string, indent, width int) string { |
| 556 | pad := width - indent - len(l) |
| 557 | if pad < 0 { |
| 558 | pad = 0 |
| 559 | } |
| 560 | return fmt.Sprintf("%s%s%s", strings.Repeat(" ", indent), l, |
| 561 | strings.Repeat(" ", pad)) |
| 562 | } |
| 563 | |
| 564 | // printHdr prints a given header label. |
| 565 | func printHdr(h string, args ...interface{}) { |
no outgoing calls
no test coverage detected