defer
package main import ( "fmt" ) func main() { for i := 0; i < 3; i++ { defer fmt.Println(i) } fmt.Println("end") }
end 2 1 0
handle