How can I control where `go get` puts things?

When I go get package (say godoc ), it wants to create and install it in /usr/lib/go/bin (this is an Ubuntu system using Go share packages).

This is not cool because, as a good Debian user, I only allow .deb packages to install files in /usr .

How can I convince him to install GOPATH in my workspace or somewhere under /usr/local ?

+4
source share
2 answers

The correct answer turned out to be the installed golang-go.tools package.

+2
source

If you install Go with GVM instead of apt, they will be placed in ~ / .gvm / gos / or your $ GOPATH instead.

https://github.com/moovweb/gvm

Also, I do not think that Godoc comes with 1.3, it should 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.

0
source

Source: https://habr.com/ru/post/1206320/


All Articles