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

     1  package main
     2  
     3  type T3 struct {
     4  	k int
     5  }
     6  
     7  type T2 struct {
     8  	h int
     9  	T3
    10  }
    11  
    12  type T struct {
    13  	f int
    14  	g int
    15  	T2
    16  }
    17  
    18  func f(i int) int { return i * i }
    19  
    20  func main() {
    21  	a := T{5, 7, T2{8, T3{9}}}
    22  	println(a.f, a.g, a.T2.h, a.T2.T3.k)
    23  }
    24  
    25  // Output:
    26  // 5 7 8 9