I'm trying out Go for the first time. I was following these docs and wanted to run the go tour locally, but I haven't figured out how to get it to work.
Where is the tool "tour" supposed to be found?
I'm on OSX 10.11.3, and I installed Go via Homebrew
my Go entries in .zshrc
export GOPATH=$HOME/code/Go
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
tour
is not installed by default with an installation of go. You need to go get
it:
go get golang.org/x/tour/gotour
It works for me using go1.4, but not with go1.7. If you just run go tool
, it gives you a list of known tools. They seem to have removed it from tools.
$ gvm use go1.7
$ go tool
addr2line
api
asm
cgo
compile
cover
dist
doc
fix
link
nm
objdump
pack
pprof
trace
vet
yacc
$ gym use go1.4
$ go tool
6a
6c
6g
6l
addr2line
cgo
cover
dist
fix
nm
objdump
pack
pprof
tour # <--- here
vet
yacc
I had a problem too. This's my solution, on OSX let try
gotour
With version go1.8.1 darwin/amd64
When you install go, tour
is not installed by default. You need to do a go get golang.org/x/tour/gotour
. This downloads gotour
in your workspace.
If you configured your PATH properly, gotour
command from anywhere in the terminal will open up your browser, but if PATH is not configured properly, do a
$GOPATH/bin/gotour
This command can be used from anywhere in your command line and it opens tour in your default browser
http://whipperstacker.com/2015/09/27/how-to-run-the-go-tour-locally/
Once gotour
is installed, it’s executable like other executables are typically stored in the bin
directory of your workspace. Inside the bin
directory ./gotour
will invoke or start gotour
, elsewhere the gotour
will need to be preceded by a path to where the executable is located. In other words $GOPATH/bin/gotour
will invoke or start gotour
when you are not inside the bin
directory.
I've got:
golang.org/x/tour/gotour has moved to golang.org/x/tour
So, this works for me:
go get golang.org/x/tour
then:
tour