From 10b28b334f9fd331a1c6adef6cb7935ce261311e Mon Sep 17 00:00:00 2001 From: Albert Nigmatzianov Date: Fri, 5 May 2017 07:21:14 +0200 Subject: Add note about panic in ShorthandLookup --- flag.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3