refactor: use reflect.TypeFor (#7313)

Signed-off-by: wyrapeseed <wyrapeseed@outlook.com>
This commit is contained in:
wyrapeseed
2025-10-22 03:26:30 +08:00
committed by GitHub
parent 1e21b660c4
commit 57587ed18e

View File

@@ -665,7 +665,7 @@ func celMatcherJSONMacroExpander(funcName string) parser.MacroExpander {
// map literals containing heterogeneous values, in this case string and list
// of string.
func CELValueToMapStrList(data ref.Val) (map[string][]string, error) {
mapStrType := reflect.TypeOf(map[string]any{})
mapStrType := reflect.TypeFor[map[string]any]()
mapStrRaw, err := data.ConvertToNative(mapStrType)
if err != nil {
return nil, err