← Back to archive

Stdle #9 · defer · 2026-06-15

What does this Go snippet output?

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

package main
import "fmt"
func main() {
w := "X"
defer fmt.Print(w)
w += "Y"
defer fmt.Print(w)
w += "Z"
fmt.Print(w, " ")
}
Defer
4 attempts left

Answer & explanation