The deferred call's arguments are evaluated immediately
In A Tour of Go is written: The deferred call's arguments are evaluated immediately, but the function call is not executed until the surrounding function returns. I have difficulty in understanding the first part of the quote. What is called immediately? func def(s string) func() { fmt.Println("tier up") fmt.Println(s) return func(){ fmt.Println("clean up") } } func main() { defer def("defered line")() fmt.Println("main") } //Output: //tier up //defered line //main //clean up https://play.golang.org/p/Av3mAEXxA4R What is deferred here and what is evaluated immediately? To learn how defer and