mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-06-27 11:42:58 +00:00
fix: linting issues
This commit is contained in:
parent
221451a517
commit
e74c958862
@ -269,15 +269,15 @@ func getRunParams(flags *pflag.FlagSet, st *storage.Storage) *settings.Server {
|
|||||||
return 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.
|
// 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
|
// 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
|
// if a flag is binded. Our alternative way is to manually check
|
||||||
// the flag and then the value from env/config/gotten by viper.
|
// the flag and then the value from env/config/gotten by viper.
|
||||||
// https://github.com/spf13/viper/pull/331
|
// https://github.com/spf13/viper/pull/331
|
||||||
func getBoolParamB(flags *pflag.FlagSet, key string) (bool, bool) {
|
func getBoolParamB(flags *pflag.FlagSet, key string) (value bool, ok bool) {
|
||||||
value, _ := flags.GetBool(key)
|
value, _ = flags.GetBool(key)
|
||||||
|
|
||||||
// If set on Flags, use it.
|
// If set on Flags, use it.
|
||||||
if flags.Changed(key) {
|
if flags.Changed(key) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user