diff options
| author | Albert Nigmatzianov <[email protected]> | 2017-05-05 07:21:14 +0200 |
|---|---|---|
| committer | Albert Nigmatzianov <[email protected]> | 2017-05-05 07:21:14 +0200 |
| commit | 10b28b334f9fd331a1c6adef6cb7935ce261311e (patch) | |
| tree | 482ef79c7a7c8630320e76d17809485b76c0836f | |
| parent | a84f757ed2ae26fca9fdb8d84d6fffa605b63fae (diff) | |
Add note about panic in ShorthandLookup
| -rw-r--r-- | flag.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -319,7 +319,9 @@ func (f *FlagSet) Lookup(name string) *Flag { return f.lookup(f.normalizeFlagName(name)) } -// ShorthandLookup returns the Flag structure of the short handed flag, returning nil if none exists. +// ShorthandLookup returns the Flag structure of the short handed flag, +// returning nil if none exists. +// It panics, if len(name) > 1. func (f *FlagSet) ShorthandLookup(name string) *Flag { if name == "" { return nil |
