mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Parse boolean in slice for gitauth (#5113)
This was causing a panic for the new `no_refesh` option!
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user