Returns the placeholder, if any, and the unquoted usage string.
(usage string)
| 19 | |
| 20 | // Returns the placeholder, if any, and the unquoted usage string. |
| 21 | func unquoteUsage(usage string) (string, string) { |
| 22 | for i := 0; i < len(usage); i++ { |
| 23 | if usage[i] == '`' { |
| 24 | for j := i + 1; j < len(usage); j++ { |
| 25 | if usage[j] == '`' { |
| 26 | name := usage[i+1 : j] |
| 27 | usage = usage[:i] + name + usage[j+1:] |
| 28 | return name, usage |
| 29 | } |
| 30 | } |
| 31 | break |
| 32 | } |
| 33 | } |
| 34 | return "", usage |
| 35 | } |
| 36 | |
| 37 | func prefixedNames(names []string, placeholder string) string { |
| 38 | var prefixed strings.Builder |
no outgoing calls