BuzzDenver (4) [Avatar] Offline
I cloned the github repo and trying to run the example. I get:

balazs@miles:~/src/goinaction-code/chapter2/sample$ go run main.go
main.go:7:2: cannot find package "" in any of:
/usr/lib/go/src/ (from $GOROOT)
($GOPATH not set)
main.go:8:2: cannot find package "" in any of:
/usr/lib/go/src/ (from $GOROOT)
($GOPATH not set)
balazs@miles:~/src/goinaction-code/chapter2/sample$ go version
go version go1.5.1 linux/amd64

Is it a version incompatibility ?
Bill Kennedy (69) [Avatar] Offline
That URL does not look right?

The code is here and therefore on disk it needs to be loaded here


Can you please check this is setup. If you need help send me an email
BuzzDenver (4) [Avatar] Offline
Thanks Bill. I was under the mistaken impression that those modules somehow get loaded over the net and maybe cached locally. All good now.
431502 (1) [Avatar] Offline
I am also having problems getting the sample code to work.
C:/Go\bin\go.exe run C:/Go/workspace/src/
2016/12/02 15:04:37 Register default matcher
2016/12/02 15:04:37 open data/data.json: The system cannot find the path specified.
2016/12/02 15:04:37 Register rss matcher
exit status 1 

This is the error i am getting, i have everything setup in %GOPATH%/src/
I'm running the main.go in chapter 2 example.
robert.panzer (3) [Avatar] Offline
Hm... requiring the user to download the code to some random position looks like an example of how to not do it.
It would have been nice to have the instructions in the book in particular as the example comprehends many different aspects and could invite the user to play with it.
jamsilver (3) [Avatar] Offline
This is how I executed the example code
1. Installed Go (see the official instructions here). I used homebrew (as I'm on OSX):

brew install go

2. Used the go get tool to fetch the book example code into the GOROOT:

go get

3. Move into the chapter directory I want (I'm using OSX with the default GOROOT of ~/go):

cd ~/go/src/

4. Run it:

go run main.go

I agree with the above commenter(s), instructions for how to run the examples seem conspicuous in their absence in chapter two. I note that in the following chapter the go get tool and remote imports get a bit more treatment, but it would perhaps be helpful to provide some explicit early instructions for running the code in a future edition.

Bill Kennedy (69) [Avatar] Offline
Thanks for the feedback and I agree! At this point there is not much I can do. If I write a 2nd edition this is something I will fix!