From 9341daefb37955409dd0081265ec3846d94c4245 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Thu, 13 Apr 2017 10:49:02 +0200 Subject: [PATCH] viper.go: GetBoolSlice --- viper.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/viper.go b/viper.go index 72b1932..4a6f639 100644 --- a/viper.go +++ b/viper.go @@ -684,6 +684,12 @@ 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 {