For the complete documentation index, see llms.txt. This page is also available as Markdown.

结构体

结构体的作用是将多个值聚合为单个实体。

一个struct零值是其字段被设为各自的零值。

struct声明方式:

type MyStruct struct {
	IntVal           int
	StringVal        string
	unexportedIntVal int
}

更进一步学习结构体

最后更新于