MCPcopy Create free account
hub / github.com/github/gh-aw / normalizeMap

Function normalizeMap

pkg/importinpututil/import_input.go:84–95  ·  view source on GitHub ↗
(rv reflect.Value)

Source from the content-addressed store, hash-verified

82}
83
84func normalizeMap(rv reflect.Value) map[string]any {
85 keys := make([]string, 0, rv.Len())
86 for _, key := range rv.MapKeys() {
87 keys = append(keys, key.String())
88 }
89 sort.Strings(keys)
90 normalized := make(map[string]any, rv.Len())
91 for _, k := range keys {
92 normalized[k] = rv.MapIndex(reflect.ValueOf(k)).Interface()
93 }
94 return normalized
95}

Callers 1

formatReflectiveValueFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected