clarkcb (1) [Avatar] Offline
#1
Hi, I noticed a couple of mistakes in the "counter with pointer" code example on bottom of page 38 (PDF p. 42):

1. fmt.Printf("Value %d
", value) -- "value" should be "counter"

2. counter++ -- should be *counter++

I verified before and after in the Go Playground. There were a couple of other things I noticed but I will need to go back and find them again. This one stuck out because it momentarily left me doubting whether I had understood how pointers work in Go.
Bill Kennedy (68) [Avatar] Offline
#2
Re: Mistakes in counter with pointer code example
Thanks for catching that. I will make sure it is fixed for the next release.
Bill Kennedy (68) [Avatar] Offline
#3
Re: Mistakes in counter with pointer code example
Done, ready for next release.
rafalgorzkowski (25) [Avatar] Offline
#4
Re: Mistakes in counter with pointer code example
"Go in action" was updated in June but this mistake still exists in mobi file (v4).
In pdf file there is no such code example (there is no subsection "2.4.4 Pass By Value")