嵌套Map的赋值问题

up_xwzhou · · 1780 次点击
你应该这样写: 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