initpy / go-book

A book for learning the Go Programming Language
http://go-book.appspot.com/
115 stars 30 forks source link

Error in Chapter: Pointers and memory #42

Closed bpursley closed 10 years ago

bpursley commented 10 years ago

"The sum of numbers from 0 to 10 is: 45 The double of this sum is: 90"

Actually, the sum of numbers from 0 to 10 is 55

Your loop only sums numbers from 0 to 9

for i:=0; i<10; i++{
    sum += i
bpursley commented 10 years ago

Sorry - wrong "go-book" with an identical chapter heading.

go-book.appsp0t.com