Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make "godoc" command work on my system?

"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?

like image 637
pymd Avatar asked Jun 08 '13 14:06

pymd


People also ask

How do I set up Godoc?

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.

How use godoc?

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.

What is godoc?

Overview. Godoc extracts and generates documentation for Go programs. It runs as a web server and presents the documentation as a web page.


1 Answers

Install godoc by using go install

go install -v golang.org/x/tools/cmd/godoc@latest 
like image 192
Roney Thomas Avatar answered Sep 20 '22 13:09

Roney Thomas