mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2024-11-16 11:23:40 +00:00
Update ch7-03.md
This commit is contained in:
parent
5c649d8c65
commit
f4a21a2269
@ -41,7 +41,7 @@ var s IntSet
|
|||||||
var _ = s.String() // OK: s is a variable and &s has a String method
|
var _ = s.String() // OK: s is a variable and &s has a String method
|
||||||
```
|
```
|
||||||
|
|
||||||
然而,由于只有`*IntSet`类型有String方法,所有也只有`*IntSet`类型实现了fmt.Stringer接口:
|
然而,由于只有`*IntSet`类型有String方法,所以也只有`*IntSet`类型实现了fmt.Stringer接口:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
var _ fmt.Stringer = &s // OK
|
var _ fmt.Stringer = &s // OK
|
||||||
|
Loading…
Reference in New Issue
Block a user