← Back to archive

Stdle #127 · defer · 2026-10-11

What does this Go snippet output?

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

package main
import "fmt"
func main() {
defer func() {
r := recover()
fmt.Printf("%v\n", r)
}()
var s []int
_ = s[3]
}
Defer
4 attempts left

Answer & explanation