mirror of
https://github.com/spf13/viper
synced 2024-09-03 22:56:20 +00:00
Handles the case of merging pflag intSlices
This commit is contained in:
parent
445d29ddaa
commit
43a90672d3
5
viper.go
5
viper.go
|
@ -961,6 +961,11 @@ func (v *Viper) find(lcaseKey string) interface{} {
|
||||||
s = strings.TrimSuffix(s, "]")
|
s = strings.TrimSuffix(s, "]")
|
||||||
res, _ := readAsCSV(s)
|
res, _ := readAsCSV(s)
|
||||||
return res
|
return res
|
||||||
|
case "intSlice":
|
||||||
|
s := strings.TrimPrefix(flag.ValueString(), "[")
|
||||||
|
s = strings.TrimSuffix(s, "]")
|
||||||
|
res, _ := readAsCSV(s)
|
||||||
|
return res
|
||||||
default:
|
default:
|
||||||
return flag.ValueString()
|
return flag.ValueString()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue