I'm trying to run the go tour
program the first time following this welcome documentation.
I've run the next command:
go install golang.org/x/website/tour@latest
But when I'm trying to run
go run tour
I get the next exception:
package tour is not in GOROOT (/usr/local/go/src/tour)
And I haven't found any additional docs of how to run the tour
program.
How to run the tour
program correctly?
Maybe I'm doing something wrong?
CodePudding user response:
go run tour
is not the correct command.
From your link,
"This will place a tour binary in your GOPATH's bin directory"
You need to find your GOPATH's bin directory, make sure it's in your $PATH (or specify absolute or relative path including that directory).
Your go bin directory may well be ~/go/bin
; mine is.
The executable you'll run is tour
, not go ...
. So maybe ~/go/bin/tour
will work for you.
Keep in mind that unlike Java, Go executables don't require a VM and so they're invoked directly.