mirror of
https://github.com/spf13/viper
synced 2025-05-06 20:27:17 +00:00
Merge 9341daefb3
into 0967fc9ace
This commit is contained in:
commit
f531e91ccd
1 changed files with 12 additions and 0 deletions
12
viper.go
12
viper.go
|
@ -685,6 +685,18 @@ func (v *Viper) GetDuration(key string) time.Duration {
|
|||
return cast.ToDuration(v.Get(key))
|
||||
}
|
||||
|
||||
// GetBoolSlice returns the value associated with the key as a slice of booleans.
|
||||
func GetBoolSlice(key string) []bool { return v.GetBoolSlice(key) }
|
||||
func (v *Viper) GetBoolSlice(key string) []bool {
|
||||
return cast.ToBoolSlice(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.
|
||||
func GetStringSlice(key string) []string { return v.GetStringSlice(key) }
|
||||
func (v *Viper) GetStringSlice(key string) []string {
|
||||
|
|
Loading…
Add table
Reference in a new issue