You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
许多面向对象的语言都有“接口”这一概念,但 Go 的接口之所以独特,是因为它们是隐式满足的。换句话说,一个具体类型不需要显式声明它实现了哪些接口;只要它拥有接口所需的方法,就自动被认为满足了该接口。这种设计让你可以为已有的具体类型创建新的接口,而不需要修改这些类型本身——这在处理你无法控制的外部包中定义的类型时特别有用
0 commit comments