package main import "fmt" type A interface { A() } type B interface { A B() } type AA struct {} type BB struct {} func (aa *AA) A() { fmt.Println("AA method A()") } func (bb *BB) A() { fmt.Println("BB method A()") } func (bb *BB) B() { fmt.Println("BB method B()") } func Factory(c *A) (d *A) { return d, nil } func main() { aa := &AA{} aa.A() fmt.Printf("hello, world\n") }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more