fix: Parse boolean in slice for gitauth (#5113)

This was causing a panic for the new `no_refesh` option!
This commit is contained in:
Kyle Carberry
2022-11-17 07:52:11 -06:00
committed by GitHub
parent 8e468c49cb
commit 60cec022eb
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -529,9 +529,11 @@ func readSliceFromViper[T any](vip *viper.Viper, key string, value any) []T {
newType := reflect.Indirect(reflect.New(elementType))
instance = &newType
}
switch instance.Field(i).Type().String() {
switch v := instance.Field(i).Type().String(); v {
case "[]string":
value = vip.GetStringSlice(configKey)
case "bool":
value = vip.GetBool(configKey)
default:
}
instance.Field(i).Set(reflect.ValueOf(value))