github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/defer2.gno (about) 1 package main 2 3 import "fmt" 4 5 func main() { 6 println("hello") 7 i := 12 8 defer func() { 9 fmt.Println("i:", i) 10 }() 11 i = 20 12 println("world") 13 } 14 15 // Output: 16 // hello 17 // world 18 // i: 20