Go语言通过 type 关键字声明结构体,格式如下:

    1. type 类型名 struct { // 标识结构体
    2. 字段1 字段1类型
    3. 字段2 字段2类型
    4. ...
    5. }

    同类型的变量也可以写在一行,用逗号隔开

    1. type Student struct {
    2. sid, age int // 同类型的变量写在同一行
    3. name string
    4. sex byte
    5. score [3]int
    6. }