mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-19 03:50:11 +08:00
modified: eBook/18.1.md
modified: eBook/18.10.md modified: eBook/18.11.md modified: eBook/18.2.md modified: eBook/18.3.md modified: eBook/18.4.md modified: eBook/18.5.md modified: eBook/18.6.md modified: eBook/18.7.md modified: eBook/18.8.md modified: eBook/18.9.md
This commit is contained in:
@@ -16,7 +16,7 @@ ms := &struct1{10, 15.5, "Chris"}
|
||||
```
|
||||
|
||||
当结构体的命名以大写字母开头时,该结构体在包外可见。
|
||||
通常情况下,为每个结构体定义一个构建函数,并推荐使用构建函数初始化结构体(参考例10.2):
|
||||
通常情况下,为每个结构体定义一个构建函数,并推荐使用构建函数初始化结构体(参考[例10.2](examples/chapter_10/person.go)):
|
||||
|
||||
```go
|
||||
ms := Newstruct1{10, 15.5, "Chris"}
|
||||
@@ -28,5 +28,5 @@ func Newstruct1(n int, f float32, name string) *struct1 {
|
||||
## 链接
|
||||
|
||||
- [目录](directory.md)
|
||||
- 上一章:[运算符模板和接口](17.4.md)
|
||||
- 下一节:[字符串](18.1.md)
|
||||
- 上一章:[映射](18.3.md)
|
||||
- 下一节:[接口](18.5.md)
|
Reference in New Issue
Block a user