← Back to archive

Stdle #162 · defer · 2026-11-15

What does this Go snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

package main
import "fmt"
func main() {
defer fmt.Println("1")
defer fmt.Println("2")
defer fmt.Println("3")
fmt.Println("0")
}
Defer
4 lines
4 attempts left

Answer & explanation