You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to use spf13/pflag without specifying a default value, and it is not a pointer, so you cannot set it to nil. pflag does have a method Changed() which can test whether something was set with the flag, as well as unexported functions to test if the value is currently the zero value.
However, if you use viper.BindPFlag, when you call IsSet, the unexported find() method will return the value of the pflag as the very last condition, and it does not check whether it is the zero value, so it will always return true.
The text was updated successfully, but these errors were encountered:
It is not possible to use spf13/pflag without specifying a default value, and it is not a pointer, so you cannot set it to nil. pflag does have a method
Changed()
which can test whether something was set with the flag, as well as unexported functions to test if the value is currently the zero value.However, if you use viper.BindPFlag, when you call IsSet, the unexported find() method will return the value of the pflag as the very last condition, and it does not check whether it is the zero value, so it will always return true.
The text was updated successfully, but these errors were encountered: