Errata

Introducing Go

Errata for Introducing Go

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 3
Under OS X subtitle.

Missing '-e' switch for 'echo'.

i.e. echo -e 'export GOPATH=$HOME\n' >> ~/.bash_profile

Also 'echo' prints a newline by default.

Dale Whitesell  Aug 27, 2018 
PDF Page 70
bottom paragraph

"In addition to lists and maps"
should be:
"in addition to slices and maps"
till that point in the book only slices were covered.

Alexander  Jun 28, 2021 
Printed Page 71
1st paragraph from the bottom

There's a missing period after:
"defined sorting functions (for slices or ints and floats)"

KJ  Mar 07, 2020 
Printed Page 75
In block for "func server"

In the line:
ln, err := net.Listen("tcp", ":9999")

It seems to assume "localhost". When running that on my CentOS 6 machine the code would give:

dial tcp 127.0.0.1:9999: connect: connection refused

This happened about 90% of the time. The other 10% it seems to work, even without recompiling the code.

When I changed the line to specify the localhost IP it works every time:
ln, err := net.Listen("tcp", "127.0.0.1:9999")

Leam Hall  May 10, 2018 
ePub Page 101
second paragraph

The instructions for running the sample program with simple math package do not work. The text says:

“Using a terminal, change directory into the math folder you just created and run go install. This will compile the math.go program and create a linkable object file: ~/pkg/os_arch/golang-book/chapter8/math.a (where os is something like windows and arch is something like amd64).
Now change back into the chapter8 folder and run go run main.go. You should see 2.5.”

(Note: I am running go version go1.14.2 darwin/amd64 on a MacBook Pro)

When I follow the instructions in the book, I get an error message:

main.go:5:2: cannot find package "IntroducingGo/chapter8/math" in any of:
/usr/local/go/src/IntroducingGo/chapter8/math (from $GOROOT)
/Users/xxx/go/src/IntroducingGo/chapter8/math (from $GOPATH)

I wonder if the changes in go package management within the last four years have cause this to break.

Joel Neely  Aug 15, 2020