by randomdata · 2y ago · 0 comments
package main
type FooInterface interface {
Baz()
}
func bar(fizz FooInterface) {
bizz.Baz()
}
type MyFoo struct{}
func (*MyFoo) Baz() {}
func main() {
var foo FooInterface = &MyFoo{}
bar(foo)
}I would not have called it a "second implementation" myself, but that's your claim to defend, not mine.
By your logic some nebulous package in a random GitHub repository that happens to satisfy an interface is also another implementation, but you would have to be completely out to lunch to think that fits with the topic of discussion.