go 基础结构体
结构体
//go 结构体使用type struct 来定义
type Student struct {
name string
age int
gender string
score float64
}
func main() {
lilei := Student{
name: "lilei",
age: 28,
gender: "women",
score: 98.7, //最后一个元素必须加, 要不就跟}同行
}
s1 := &lilei
print(s1.name)
}
浙公网安备 33010602011771号