"godoc" doesnt' work on my system.(I'm using ubuntu 13.04)
godoc fmt
gives the following error
2013/06/08 19:12:43 readTemplate: open /usr/lib/go/lib/godoc/codewalk.html: no such file or directory
"which go" gives:
/usr/bin/go
"go env" gives the following:
GOROOT="/usr/lib/go" GOBIN="" GOARCH="386" GOCHAR="8" GOOS="linux" GOEXE="" GOHOSTARCH="386" GOHOSTOS="linux" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_386" GOGCCFLAGS="-g -O2 -fPIC -m32 -pthread" CGO_ENABLED="1"
What should I do to make it work?
Run go generate golang.org/x/tools/godoc/static so static/static.go picks up the change. Run go install golang.org/x/tools/cmd/godoc so the compiled godoc binary picks up the change. Run godoc -http=:6060 and view your changes in the browser. You may need to disable your browser's cache to avoid reloading a stale file.
You can add URLs that Godoc will generate links for and structure your comments into paragraphs. If you want to link to a resource, write the URL in your comment, and Godoc will recognize it and add a link. For paragraphs, leave an empty comment line. // Document represents a regular document.
Overview. Godoc extracts and generates documentation for Go programs. It runs as a web server and presents the documentation as a web page.
Install godoc by using go install
go install -v golang.org/x/tools/cmd/godoc@latest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With