mirror of
https://github.com/spf13/viper
synced 2024-12-23 12:07:02 +00:00
Removes superfluous block for intSlice, and appends to stringSlice instead
This commit is contained in:
parent
bd294940f9
commit
7b01606243
1 changed files with 2 additions and 7 deletions
9
viper.go
9
viper.go
|
@ -925,12 +925,7 @@ func (v *Viper) find(lcaseKey string) interface{} {
|
|||
return cast.ToInt(flag.ValueString())
|
||||
case "bool":
|
||||
return cast.ToBool(flag.ValueString())
|
||||
case "stringSlice":
|
||||
s := strings.TrimPrefix(flag.ValueString(), "[")
|
||||
s = strings.TrimSuffix(s, "]")
|
||||
res, _ := readAsCSV(s)
|
||||
return res
|
||||
case "intSlice":
|
||||
case "stringSlice", "intSlice":
|
||||
s := strings.TrimPrefix(flag.ValueString(), "[")
|
||||
s = strings.TrimSuffix(s, "]")
|
||||
res, _ := readAsCSV(s)
|
||||
|
@ -999,7 +994,7 @@ func (v *Viper) find(lcaseKey string) interface{} {
|
|||
return cast.ToInt(flag.ValueString())
|
||||
case "bool":
|
||||
return cast.ToBool(flag.ValueString())
|
||||
case "stringSlice":
|
||||
case "stringSlice", "intSlice":
|
||||
s := strings.TrimPrefix(flag.ValueString(), "[")
|
||||
s = strings.TrimSuffix(s, "]")
|
||||
res, _ := readAsCSV(s)
|
||||
|
|
Loading…
Reference in a new issue