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

     1  package main
     2  
     3  type fn func(int)
     4  
     5  func test(f fn, v int) { f(v) }
     6  
     7  func main() {
     8  	f1 := func(i int) { println("f1", i) }
     9  	test(f1, 21)
    10  }
    11  
    12  // Output:
    13  // f1 21