标签:UNC pre print code map 接口 make 断言 class
func main() {
s := student{1, "wqx", ‘m‘, 15, "hefei"}
m := make(map[int]interface{})
m[0] = s
v, ok := m[0].(student) // 断言
if ok {
fmt.Println(v.age)
}
}
标签:UNC pre print code map 接口 make 断言 class
原文地址:https://www.cnblogs.com/cnloop/p/9449429.html