← Back to archive

Stdle #82 · classes · 2026-08-27

What does this Go snippet output?

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

package main
import "fmt"
type T struct{ N int }
func main() {
ts := []T{{1}, {2}}
for _, t := range ts {
t.N *= 10
}
fmt.Println(ts[0].N, ts[1].N)
}
Classes
4 attempts left

Answer & explanation