mirror of https://github.com/spf13/viper.git
Added capacity to slice creation
This commit is contained in:
parent
40e41dd224
commit
72b022eb35
2
viper.go
2
viper.go
|
@ -1723,7 +1723,7 @@ func (v *Viper) AllKeys() []string {
|
||||||
m = v.flattenAndMergeMap(m, v.defaults, "")
|
m = v.flattenAndMergeMap(m, v.defaults, "")
|
||||||
|
|
||||||
// convert set of paths to list
|
// convert set of paths to list
|
||||||
a := []string{}
|
a := make([]string, 0, len(m))
|
||||||
for x := range m {
|
for x := range m {
|
||||||
a = append(a, x)
|
a = append(a, x)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue