github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/recover3.gno (about) 1 package main 2 3 import "fmt" 4 5 func main() { 6 println("hello") 7 8 var r interface{} = 1 9 r = recover() 10 fmt.Printf("%v\n", r) 11 if r == nil { 12 println("world") 13 } 14 if r != nil { 15 println("exception") 16 } 17 } 18 19 // Output: 20 // hello 21 // <nil> 22 // world