go: cmd/godoc: confused by symlinks in GOROOT: godoc: corpus fstree is nil

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)? go version go1.6 linux/amd64
  2. What operating system and processor architecture are you using (go env)? GOARCH=“amd64” GOBIN=“” GOEXE=“” GOHOSTARCH=“amd64” GOHOSTOS=“linux” GOOS=“linux” GOPATH=“/home/me/Code/go” GORACE=“” GOROOT=“/usr/lib/go” GOTOOLDIR=“/usr/lib/go/pkg/tool/linux_amd64” GO15VENDOREXPERIMENT=“1” CC=“gcc” GOGCCFLAGS=“-fPIC -m64 -pthread -fmessage-length=0” CXX=“g++” CGO_ENABLED=“1”
  3. What did you do? go get golang.org/x/tools/cmd/godoc sudo -E go install golang.org/x/tools/cmd/godoc godoc -http=":8080"
  4. What did you expect to see? godoc running on the command line, listening to HTTP requests
  5. What did you see instead? “2016/03/31 11:15:45 godoc: corpus fstree is nil”, followed by program exit with status code -1
  6. Other notes
    • It was working when I was running go 1.5, I added the ubuntu-lxc/lxd-stable ppa and upgraded to go 1.6.
    • I tried running go get with --update, and then tried removing all references I could find to godoc and the installing again using the commands from question # 3.
    • which godoc gives “/usr/lib/go/bin/godoc”
    • godoc net/http prints the documentation on the command line, as expected.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 19 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Here’s a partially functioning workaround for anyone who cares.

If I run godoc -http=":8080 -goroot /usr/share/go (where /usr/share/go is the path that some of the symlinks in GOROOT point to) the server starts. It can’t find the “Documents” page so I can’t view “Effective Go” and friends locally, but at least I can navigate around package docs, including my own packages.

I got this working by removing the docs symlink and taking a copy of the docs source…

in /usr/lib/go-1.6

sudo mv doc doc.old
sudo cp -ra ../../share/doc/golang-1.6-doc/html doc