1
0
Fork 0

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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 6 deletions

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 {