godoc – How to install static content removed from golang with go 1.13-ThrowExceptions

Exception or error:

Before go 1.13, I could run the version of godoc that came with go as godoc -http localhost:6060. This would not only show me the documentation for all of my source code, but also static content from the go web page, including for example the go language specification.

What’s the easiest way to make this content available offline with go 1.13? I was of course able to install godoc and view my own godoc documentation, but not the other web site contents. I tried things like go get -u golang.org/x/website to no avail.

For what it’s worth, I’m using arch linux, so if there’s no way to do this with go get I’d also be interested in installing an arch or AUR package.

How to solve:

The static content hasn’t stopped being shipped with go (it’s a bunch of .html files in $GOROOT/doc/), only the godoc server has. If you install godoc, addresses like http://localhost:6060/ref/spec work just fine; I just tested it. If it’s not working for you, perhaps the -goroot flag to godoc would be of use?

Leave a Reply

Your email address will not be published. Required fields are marked *