mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:43:26 +08:00
@@ -211,7 +211,8 @@ type Fooer interface {
|
||||
|
||||
```go
|
||||
type Bar struct{}
|
||||
func (b Bar) ImplementsFooer() {} func (b Bar) Foo() {}
|
||||
func (b Bar) ImplementsFooer() {}
|
||||
func (b Bar) Foo() {}
|
||||
```
|
||||
|
||||
大部分代码并不使用这样的约束,因为它限制了接口的实用性。
|
||||
|
Reference in New Issue
Block a user