fix: unmarshal problem on env vars for type env string (#5037)

Signed-off-by: kevin <wanjunfeng@gmail.com>
Signed-off-by: Kevin Wan <wanjunfeng@gmail.com>
This commit is contained in:
Kevin Wan
2025-07-30 18:09:25 +08:00
committed by GitHub
parent 25f37ca750
commit d505fae979
3 changed files with 112 additions and 9 deletions

View File

@@ -583,6 +583,10 @@ func toFloat64(v any) (float64, bool) {
}
}
func toReflectValue(tp reflect.Type, v any) reflect.Value {
return reflect.ValueOf(v).Convert(Deref(tp))
}
func usingDifferentKeys(key string, field reflect.StructField) bool {
if len(field.Tag) > 0 {
if _, ok := field.Tag.Lookup(key); !ok {