Refactor to use reflect.TypeFor

This commit is contained in:
cui
2025-08-21 22:10:07 +08:00
committed by GitHub
parent 50f95dd909
commit 86422af988
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ func encodeRawValue(labels map[string]string, root string, rawValue interface{})
if tValue.Kind() == reflect.Map && tValue.Elem().Kind() == reflect.Interface {
r := reflect.ValueOf(rawValue).
Convert(reflect.TypeOf((map[string]interface{})(nil))).
Convert(reflect.TypeFor[map[string]interface{}]()).
Interface().(map[string]interface{})
for k, v := range r {