From e1be66a59d347d377025c1ef0fa20b3af80e0370 Mon Sep 17 00:00:00 2001 From: AI Engineer Date: Fri, 1 May 2026 21:04:08 +0800 Subject: [PATCH] chore: save local changes (by AI) --- convert.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/convert.go b/convert.go index f844afe..9e0e9ba 100644 --- a/convert.go +++ b/convert.go @@ -66,7 +66,7 @@ func performConversion(source, destination any) *reflect.Value { if realDestination.CanAddr() { address := realDestination.Addr().Interface() if unmarshaler, isJSONUnmarshaler := address.(json.Unmarshaler); isJSONUnmarshaler { - _ = unmarshaler.UnmarshalJSON(cast.MustJsonBytes(realSource.Interface())) + _ = unmarshaler.UnmarshalJSON(cast.MustJSONBytes(realSource.Interface())) return nil } if unmarshaler, isYAMLUnmarshaler := address.(yaml.Unmarshaler); isYAMLUnmarshaler { @@ -109,7 +109,7 @@ func performConversion(source, destination any) *reflect.Value { case reflect.Slice: if destinationType.Elem().Kind() == reflect.Uint8 { - applyValue(realDestination, reflect.ValueOf(cast.MustJsonBytes(realSource.Interface())), &allocatedValue) + applyValue(realDestination, reflect.ValueOf(cast.MustJSONBytes(realSource.Interface())), &allocatedValue) } else { normalizedSource := realSource if sourceType.Kind() == reflect.String { @@ -122,7 +122,7 @@ func performConversion(source, destination any) *reflect.Value { normalizedSource = tempSlice } else { var rawList []any - cast.UnJson(sourceStr, &rawList) + cast.UnmarshalJSON(sourceStr, &rawList) normalizedSource = reflect.ValueOf(rawList) } } else if sourceType.Kind() != reflect.Slice { @@ -141,7 +141,7 @@ func performConversion(source, destination any) *reflect.Value { convertStructToStruct(effectiveSource, realDestination) case reflect.String: var rawMap map[string]any - cast.UnJson(effectiveSource.String(), &rawMap) + cast.UnmarshalJSON(effectiveSource.String(), &rawMap) convertMapToStruct(reflect.ValueOf(rawMap), realDestination) } @@ -157,7 +157,7 @@ func performConversion(source, destination any) *reflect.Value { convertStructToMap(realSource, realDestination) case reflect.String: var rawMap map[string]any - cast.UnJson(realSource.String(), &rawMap) + cast.UnmarshalJSON(realSource.String(), &rawMap) convertMapToMap(reflect.ValueOf(rawMap), realDestination) }