refactor flag names - make it more explicitly

avoid the using 'reflect' package while getting flag names
This commit is contained in:
Dmitry Kutakov
2019-12-29 08:58:12 +01:00
committed by Dmitry
parent 25e0c70969
commit 8c28ae347a
16 changed files with 16 additions and 30 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ func (f *StringFlag) String() string {
// Names returns the names of the flag
func (f *StringFlag) Names() []string {
return flagNames(f)
return flagNames(f.Name, f.Aliases)
}
// IsRequired returns whether or not the flag is required