mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2024-11-24 15:18:57 +00:00
commit
3cd7b5557d
@ -41,7 +41,7 @@ var s IntSet
|
||||
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
|
||||
var _ fmt.Stringer = &s // OK
|
||||
|
Loading…
Reference in New Issue
Block a user