github.com/traefik/yaegi@v0.15.1/_test/struct27.go (about)

     1  package main
     2  
     3  import "fmt"
     4  
     5  func (f *Foo) Boo() { fmt.Println(f.name, "Boo") }
     6  
     7  type Foo struct {
     8  	name string
     9  	fun  func(f *Foo)
    10  }
    11  
    12  func main() {
    13  	t := &Foo{name: "foo"}
    14  	t.Boo()
    15  }
    16  
    17  // Output:
    18  // foo Boo