MCPcopy Create free account
hub / github.com/aws-samples/devsecops-quickstart / mapify

Function mapify

devsecops_quickstart/opa_scan/pkg/utils/utils.go:34–44  ·  view source on GitHub ↗
(i interface{})

Source from the content-addressed store, hash-verified

32}
33
34func mapify(i interface{}) (map[string]interface{}, bool) {
35 value := reflect.ValueOf(i)
36 if value.Kind() == reflect.Map {
37 m := map[string]interface{}{}
38 for _, k := range value.MapKeys() {
39 m[k.String()] = value.MapIndex(k).Interface()
40 }
41 return m, true
42 }
43 return map[string]interface{}{}, false
44}

Callers 1

mergeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected