> For the complete documentation index, see [llms.txt](https://denglj.gitbook.io/essential-go/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://denglj.gitbook.io/essential-go/02-basic-types/jie-gou-ti.md).

# 结构体

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

一个`struct`的[零值](/essential-go/02-basic-types/ling-zhi.md)是其字段被设为各自的零值。

`struct`声明方式：

```go
type MyStruct struct {
	IntVal           int
	StringVal        string
	unexportedIntVal int
}
```

更进一步学习[结构体](/essential-go/10-structs.md)。
