mirror of https://github.com/spf13/viper.git
viper.go: GetDurationSlice
This commit is contained in:
parent
5d46e70da8
commit
0d3c5c6c30
6
viper.go
6
viper.go
|
@ -684,6 +684,12 @@ func (v *Viper) GetDuration(key string) time.Duration {
|
||||||
return cast.ToDuration(v.Get(key))
|
return cast.ToDuration(v.Get(key))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDurationSlice returns the value associated with the key as a slice of durations.
|
||||||
|
func GetDurationSlice(key string) []string { return v.GetDurationSlice(key) }
|
||||||
|
func (v *Viper) GetDurationSlice(key string) []string {
|
||||||
|
return cast.ToDurationSlice(v.Get(key))
|
||||||
|
}
|
||||||
|
|
||||||
// GetStringSlice returns the value associated with the key as a slice of strings.
|
// GetStringSlice returns the value associated with the key as a slice of strings.
|
||||||
func GetStringSlice(key string) []string { return v.GetStringSlice(key) }
|
func GetStringSlice(key string) []string { return v.GetStringSlice(key) }
|
||||||
func (v *Viper) GetStringSlice(key string) []string {
|
func (v *Viper) GetStringSlice(key string) []string {
|
||||||
|
|
Loading…
Reference in New Issue