A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-70.go
1packagemain
2
3import"fmt"
4
5funcmod(a[3]int){
6a[0]=99
7}
8
9funcmain(){
10a:=[3]int{1,2,3}
11mod(a)
12fmt.Println(a[0])
13}
Slices
Answer & explanation
Console output
1
Why
Because arrays are value types, passing one to a function copies the entire array. mod mutates only its local copy, so the caller’s array is unchanged and a[0] remains 1. To mutate the original you would pass a pointer or use a slice.