fix: Allow custom Git OAuth URLs (#4758)

Fixes an issue reported in Discord where custom endpoints
weren't working.
This commit is contained in:
Kyle Carberry
2022-10-27 10:38:05 -07:00
committed by GitHub
parent 3e15ee3ba0
commit b34a67e6cb
8 changed files with 63 additions and 13 deletions
+7 -1
View File
@@ -462,7 +462,8 @@ func readSliceFromViper[T any](vip *viper.Viper, key string, value any) []T {
if prop == "-" {
prop = fve.Tag.Get("yaml")
}
value := vip.Get(fmt.Sprintf("%s.%d.%s", key, entry, prop))
configKey := fmt.Sprintf("%s.%d.%s", key, entry, prop)
value := vip.Get(configKey)
if value == nil {
continue
}
@@ -470,6 +471,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() {
case "[]string":
value = vip.GetStringSlice(configKey)
default:
}
instance.Field(i).Set(reflect.ValueOf(value))
}
if instance == nil {