Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardGodefer panic recover mechanicsSingle-choice MCQ

In the Go runtime, how is a deferred call with arguments handled when those arguments are evaluated at defer-statement time (the "open-coded" defer optimization aside)?

package main import "fmt" func main() { i := 0 defer fmt.Println(i) i++ defer fmt.Println(i) i++ }