Fix(issue #631). Remove reflect calls for Hidden field

This commit is contained in:
Naveen Gogineni
2021-03-25 20:45:30 -04:00
committed by Naveen Gogineni
parent 13ded1e7c4
commit df595c0d85
16 changed files with 84 additions and 2 deletions

View File

@@ -55,6 +55,11 @@ func (f *StringFlag) GetValue() string {
return f.Value
}
// IsVisible returns true if the flag is not hidden, otherwise false
func (f *StringFlag) IsVisible() bool {
return !f.Hidden
}
// Apply populates the flag given the flag set and environment
func (f *StringFlag) Apply(set *flag.FlagSet) error {
if val, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok {