请教golang如何实现其他文件中定义的接口

bwilling · · 4550 次点击
Dog和Cat都没有实现Run方法
#3
更多评论
Cat 有Say() 和 Run() 方法就可以了
#1
就是我b.go这那么写的吗?但是并不对啊 ``` var an be.Animail an = new(model.Cat) ``` 这段代码是报错的,提示: ``` Cannot use new(model.Cat) (type *model.Cat) as type be.Animail in assignment less... (⌘F1) Reports incompatible types in binary and unary expressions. ```
#2