> For the complete documentation index, see [llms.txt](https://rodneycheung.gitbook.io/handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rodneycheung.gitbook.io/handbook/3.-yu-yan-pian/golang/dai-ma-gui-fan/embedding_in_struct.md).

# 嵌套式结构体

构建结构体时如果其中有字段的类型同样为结构体，需要将其与常规字段隔开。

```go
//bad usage
type Client struct {
  version int
  http.Client
}

//good usage
type Client struct {
  http.Client

  version int
}
```
