mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:05:14 +08:00
modified: eBook/10.1.md
This commit is contained in:
@@ -138,7 +138,7 @@ type Point struct { x, y int }
|
||||
|
||||
类型 strcut1 在定义它的包 pack1 中必须是唯一的,它的完全类型名是:`pack1.struct1`。
|
||||
|
||||
下面的例子 [Listing 10.2—person.go](examples/chapter_10/struct_pack/person.go) 显示了一个结构体 Person,一个方法,方法有一个类型为 `*Person` 的参数(因此对象本身是可以被改变的),以及三种调用这个方法的不同方式:
|
||||
下面的例子 [Listing 10.2—person.go](examples/chapter_10/person.go) 显示了一个结构体 Person,一个方法,方法有一个类型为 `*Person` 的参数(因此对象本身是可以被改变的),以及三种调用这个方法的不同方式:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
Reference in New Issue
Block a user