mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
18 lines
212 B
Go
18 lines
212 B
Go
package main
|
|
|
|
func run(fn func(name string)) { fn("test") }
|
|
|
|
type T2 struct {
|
|
name string
|
|
}
|
|
|
|
func (t *T2) f(s string) { println(s, t.name) }
|
|
|
|
func main() {
|
|
t2 := &T2{"foo"}
|
|
run(t2.f)
|
|
}
|
|
|
|
// Output:
|
|
// test foo
|