diff options
| author | Eric Paris <[email protected]> | 2017-05-05 09:40:53 -0400 |
|---|---|---|
| committer | Albert Nigmatzianov <[email protected]> | 2017-05-05 16:36:56 +0200 |
| commit | 80fe0fb4eba54167e2ccae1c6c950e72abf61b73 (patch) | |
| tree | 43848e259c223b1891f60613f48a1cb29398b128 /flag.go | |
| parent | 75859d1ee5f135362c9534f7db667e0150d9f577 (diff) | |
Testing for Shorthand Lookup
Diffstat (limited to 'flag.go')
| -rw-r--r-- | flag.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -327,7 +327,9 @@ func (f *FlagSet) ShorthandLookup(name string) *Flag { return nil } if len(name) > 1 { - panic("can't look up for a shorthand with name more than one character") + msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name) + fmt.Fprintf(f.out(), msg) + panic(msg) } c := name[0] return f.shorthands[c] |
