github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/struct5.gno (about)

     1  package main
     2  
     3  type T struct {
     4  	f int
     5  	g int
     6  }
     7  
     8  func f(i int) int { return i * i }
     9  
    10  func main() {
    11  	a := T{7, f(4)}
    12  	println(a.f, a.g)
    13  }
    14  
    15  // Output:
    16  // 7 16