aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
authorAlbert Nigmatzianov <[email protected]>2017-05-05 07:21:14 +0200
committerAlbert Nigmatzianov <[email protected]>2017-05-05 07:21:14 +0200
commit10b28b334f9fd331a1c6adef6cb7935ce261311e (patch)
tree482ef79c7a7c8630320e76d17809485b76c0836f /flag.go
parenta84f757ed2ae26fca9fdb8d84d6fffa605b63fae (diff)
Add note about panic in ShorthandLookup
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/flag.go b/flag.go
index 6ea0c48..801a444 100644
--- a/flag.go
+++ b/flag.go
@@ -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