godoc command doesn't work on my system (I'using Linux Mint 20 Ulyana).
I've just tried this procedure:
go get golang.org/x/tools/cmd/godoc
godoc -http=:6060
The result is:
bash: godoc: command not found
I'm using this go version go version go1.15 linux/amd64
And this is my PATH variable /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin
All other go commands (go build, go run and so on) work correctly.
What can I do to make godoc command work?
Add $GOPATH/bin
to your PATH
variable. Executables, like godoc
, are installed to $GOPATH/bin
.
export PATH="$GOPATH/bin:$PATH"
godoc -http=:6060