diff --git a/cmd/root.go b/cmd/root.go index 3ad52f3f..58179daf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -269,15 +269,15 @@ func getRunParams(flags *pflag.FlagSet, st *storage.Storage) *settings.Server { return server } -// getStringParamB returns a parameter as a string and a boolean to tell if it is different from the default +// getBoolParamB returns a parameter as a string and a boolean to tell if it is different from the default // // NOTE: we could simply bind the flags to viper and use IsSet. // Although there is a bug on Viper that always returns true on IsSet // if a flag is binded. Our alternative way is to manually check // the flag and then the value from env/config/gotten by viper. // https://github.com/spf13/viper/pull/331 -func getBoolParamB(flags *pflag.FlagSet, key string) (bool, bool) { - value, _ := flags.GetBool(key) +func getBoolParamB(flags *pflag.FlagSet, key string) (value bool, ok bool) { + value, _ = flags.GetBool(key) // If set on Flags, use it. if flags.Changed(key) {