String returns the string representation of the arguments, trimming empty arguments from the end.
()
| 20 | |
| 21 | // String returns the string representation of the arguments, trimming empty arguments from the end. |
| 22 | func (a *OptionArgs) String() string { |
| 23 | // Trim empty args from the end |
| 24 | args := a.args[:] |
| 25 | for len(args) > 0 && args[len(args)-1] == "" { |
| 26 | args = args[:len(args)-1] |
| 27 | } |
| 28 | |
| 29 | return strings.Join(args, ":") |
| 30 | } |
| 31 | |
| 32 | // OptionsBuilder is a helper for building options strings in tests. |
| 33 | type OptionsBuilder map[string]*OptionArgs |