嵌套Map的赋值问题

up_xwzhou · · 1770 次点击
你应该这样写: testMap := make(map[string]interface{}) testMap["Level1"] = make(map[interface{}]interface{}) testMap["Level1"].(map[interface{}]interface{})["level2"] = make(map[interface{}]interface{}) testMap["Level1"].(map[interface{}]interface{})["level2"].(map[interface{}]interface{})["level3"] = "value"
#1