1、定义结构体
type Student struct {
name string
code int
}2、类型别名
type i int64
var age i = 30
3、定义接口
type inter interface{
eat()
walk()
}
4、定义函数类型
type fun_handler func(name string) int
type本职都是做和类型相关的事。
1、定义结构体
type Student struct {
name string
}type i int64
type fun_handler func(name string) int
相关文章: