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) } }