英文:
How do I control where `go get` puts things?
问题
当我使用go get
命令获取一个包(比如godoc
),它会想要在/usr/lib/go/bin
目录下创建并安装该包(这是一个使用标准Go软件包的Ubuntu系统)。
这并不好,因为作为一个合格的Debian用户,我只允许.deb
软件包将东西安装到/usr
目录下。
我该如何说服它将包安装到我的GOPATH
工作空间或者/usr/local
目录的某个位置呢?
英文:
When I go get
a package (say, godoc
), it wants to create and install it in /usr/lib/go/bin
(this is an Ubuntu system using the stock Go packages).
This isn't cool, because like a good Debian user I only let .deb packages install stuff into /usr
.
How do I convince it to install into either my GOPATH
workspace, or somewhere under /usr/local
?
答案1
得分: 2
正确答案是安装golang-go.tools
软件包。
英文:
The correct answer turned out to be installing the golang-go.tools
package.
答案2
得分: 0
如果您使用GVM而不是通过apt安装Go,则它们将被放置在~/.gvm/gos/或您的$GOPATH中。
https://github.com/moovweb/gvm
此外,我认为godoc不再随1.3版本一起提供,必须从go.tools安装。
http://godoc.org/code.google.com/p/go.tools/cmd/godoc
http://golang.org/doc/go1.2#go_doc
> "go doc"命令已被删除。
英文:
If you install Go with GVM instead of from apt they will be placed in ~/.gvm/gos/ or your $GOPATH instead.
https://github.com/moovweb/gvm
Also I don't think godoc comes with 1.3 anymore, it has to be installed from go.tools
http://godoc.org/code.google.com/p/go.tools/cmd/godoc
http://golang.org/doc/go1.2#go_doc
> The "go doc" command is deleted.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论