mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
* gi: rename gi_c into _gi_c * gi: rename test into _test * gi: fix README syntax
34 lines
313 B
Go
34 lines
313 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
type Foo struct {
|
|
}
|
|
|
|
func (Foo) Call() {
|
|
fmt.Println("Foo Called")
|
|
}
|
|
|
|
type Bar struct {
|
|
Foo
|
|
}
|
|
|
|
type Baz struct {
|
|
Foo
|
|
}
|
|
|
|
func (Baz) Call() {
|
|
fmt.Println("Baz Called")
|
|
}
|
|
|
|
func main() {
|
|
Foo{}.Call()
|
|
Bar{}.Call()
|
|
Baz{}.Call()
|
|
}
|
|
|
|
// Output:
|
|
// Foo Called
|
|
// Foo Called
|
|
// Baz Called
|