-1

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.

user3188445
  • 4,062
  • 16
  • 26

1 Answers1

2

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?

hobbs
  • 223,387
  • 19
  • 210
  • 288
  • Hmm... Could it be that arch's go-tools package is broken? If I run godoc from within my gopath (`~/go/bin/godoc -http :6060`) it seems to work, but the version in `/usr/bin/gopath` does not provide access to this contents. – user3188445 Oct 17 '19 at 22:01
  • As the answer says, the godoc server is no longer shipping with Go. If you've installed it yourself, it would be in `~/go/bin/godoc`. So what you're seeing is the expected behavior. – Adrian Oct 18 '19 at 13:25