package main
import "fmt"
func main() {
// A defer statement defers the execution of a
// function until the function where said "deferred
// function" resides also returns. The deferred
// call arguments are evaluated immediately, though.
i := 0
defer fmt.Println(i)
i++
fmt.Println(i)
}
To embed this program on your website, copy the following code and paste it into your website's HTML: