mirror of
https://github.com/spf13/viper
synced 2024-11-20 03:47:05 +00:00
Handles the case of merging pflag intSlices
This commit is contained in:
parent
1d33b640d9
commit
bd294940f9
1 changed files with 5 additions and 0 deletions
5
viper.go
5
viper.go
|
@ -930,6 +930,11 @@ func (v *Viper) find(lcaseKey string) interface{} {
|
|||
s = strings.TrimSuffix(s, "]")
|
||||
res, _ := readAsCSV(s)
|
||||
return res
|
||||
case "intSlice":
|
||||
s := strings.TrimPrefix(flag.ValueString(), "[")
|
||||
s = strings.TrimSuffix(s, "]")
|
||||
res, _ := readAsCSV(s)
|
||||
return res
|
||||
default:
|
||||
return flag.ValueString()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue