Thank you for such an incredible book. While reading the fourth season (control structures), I noticed a small mistake. In section 4.2.2 (Arrays), there are three examples demonstrating range loop behavior. The second example is:
a := [3]int{0, 1, 2}
for i := range a {
a[2] = 10
if i == 2 {
fmt.Printf(a[2])
}
}
The description says:
Because we access the original array, this code prints 2 instead of 10.
However, if you run the code, the number 10 will be shown in the console, which makes sense.
Thank you for such an incredible book. While reading the fourth season (control structures), I noticed a small mistake. In section 4.2.2 (Arrays), there are three examples demonstrating range loop behavior. The second example is:
The description says:
However, if you run the code, the number 10 will be shown in the console, which makes sense.