mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
21 lines
206 B
Go
21 lines
206 B
Go
package main
|
|
|
|
type I interface {
|
|
Hello()
|
|
}
|
|
|
|
type T struct {
|
|
Name string
|
|
Child []*T
|
|
}
|
|
|
|
func (t *T) Hello() { println("Hello", t.Name) }
|
|
|
|
func main() {
|
|
var i I = new(T)
|
|
i.Hello()
|
|
}
|
|
|
|
// Output:
|
|
// Hello
|