MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / recursionReadKey

Function recursionReadKey

resources/access/access_test.go:94–112  ·  view source on GitHub ↗

递归读取文件中name字段

(key string, data map[string]interface{}, result map[string]string)

Source from the content-addressed store, hash-verified

92
93// 递归读取文件中name字段
94func recursionReadKey(key string, data map[string]interface{}, result map[string]string) {
95 for k, v := range data {
96 switch t := v.(type) {
97 case string:
98 if k == key {
99 result[strings.ToLower(t)] = ""
100 }
101 case map[string]interface{}:
102 recursionReadKey(key, t, result)
103 case []interface{}:
104 for _, n := range t {
105 switch tt := n.(type) {
106 case map[string]interface{}:
107 recursionReadKey(key, tt, result)
108 }
109 }
110 }
111 }
112}

Callers 1

TestPrintNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected