這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。
Go升級到1.4之後,liteIDE啟動會提示:
11:29:27 GolangDoc: Could not find godoc, (hint: is godoc installed?)
原因是:
Changes to package source layout
In the main Go source repository, the source code for the packages was kept inthe directorysrc/pkg
, which made sense but differed fromother repositories, including the Go subrepositories.In Go 1.4, the pkg
level of the source tree is now gone, so for examplethefmt
package's source, once kept indirectorysrc/pkg/fmt
, now lives one level higher in src/fmt
.
Updating: Tools like godoc
that discover source codeneed to know about the new location. All tools and services maintained by the Go teamhave been updated.
解決辦法:
1.
翻牆 go get -v -u golang.org/x/tools/cmd/godoc
不翻牆 git clone https://github.com/golang/tools $GOPATH/src/golang.org/x/tools
2.
go build $GOPATH/src/golang.org/x/tools/cmd/godoc
mv $GOPATH/src/golang.org/x/tools/cmd/godoc/godoc $GOPATH/bin/