自然是可以的,當然map不能作為另壹個map的key,只能做value。請參考以下例子:
package?mainimport?"fmt"
type?t_classmates?map[string]int
func?main()?{
domitory?:=?make(map[string]t_classmates) class1?:=?make(t_classmates) class1["zhangsan"]?=?23 class1["lisi"]?=?24 domitory["308"]?=?class1 domitory["309"]?=?t_classmates{"wangwu":?25,?"zhaoliu":?26,} fmt.Println(domitory)}