I have three files:
node.go:
type Node interface {
AMethod(arg ArgType) bool
BMethod() bool
}
anode.go:
type aNode struct {}
func AMethod(aNode ANode, arg ArgType) bool {
return true
}
func BMethod(aNode ANode) bool {
return true
}
bnode.go:
type bNode struct {}
func AMethod(bNode BNode, arg ArgType) bool {
return true
}
func BMethod(bNode BNode) bool {
return true
}
But I'm getting the error:
Nodes/bnode.go:16:58: AMethod redeclared in this block
previous declaration at Nodes/anode.go:15:58
Nodes/bnode.go:20:60: BMethod redeclared in this block
previous declaration at Nodes/anode.go:19:60
How do I validly implement an interface here?