开始行动

I've installed go (and tested it). When I run go env I see this:

$ go env
GOROOT="/usr/lib/go"
GOBIN=""
GOARCH="386"
GOCHAR="8"
GOOS="linux"
GOEXE=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_386"
GOGCCFLAGS="-g -O2 -fPIC -m32 -pthread"
CGO_ENABLED="1"

However, when I run go get code.google.com/p/go-tour/gotour to get started with the tour locally (per the instructions), nothing seems to happen (I get no output, though it does take a couple of seconds to run, which makes me think something must have happened).

The instructions say to run the resultant gotour executable, but I can't find one. Anyone know what I'm doing wrong? I'm starting to feel like I must be pretty dumb, but I just can't figure out what running go get did (did it install anything? did it succeed?).

Have you looked in /usr/lib/go/bin? Or, if you set a gopath $GOPATH/bin.

By default, go get only prints if there was an error. The resultant executable is placed in the GOBIN, the GOROOT bin, or the GOPATH bin.

The gotour executable should already be provided by your go installation.

When you run gotour without executing the instructed go get prior, it should provide you with an import error.

2012/07/28 09:10:18 Couldn't find tour files: import "code.google.com/p/go-tour/": cannot find package

Running go get will get the source - in this case from code.google.com/p/go-tour - and place it into your active go environments source folders, in your case GOROOT="/usr/lib/go"(, if no GOPATH is set). The source will be placed in the subfolder src/pkg/code.google.com/p/go-tour.

With the source checked out, running gotour again, it can compile its necessary files and use the static files from that repository to serve you the gotour locally. When running gotour it should present you with something like

2012/07/28 09:10:00 Serving content from C:\Go\src\pkg\code.google.com\p\go-tour
2012/07/28 09:10:00 Serving at http://127.0.0.1:3999/

You can then browse the gotour via the address provided.

As a side-note, as as I understood you, you missed this: You don’t need to run it locally. It is merely the gotour website you are browsing, just instantiated locally, though the repository you got via go get.

Typing: $GOPATH/bin/gotour does exactly what you want.