Where does go get install packages?

16,923 views
Skip to first unread message

Dean Schulze

unread,
Oct 25, 2013, 4:19:06 PM10/25/13
to golan...@googlegroups.com
I thought I understood how go get works, but apparently not.  I have GOPATH set to ~/src/golang/go3p and I execute this command


Nothing was installed in ~/src/golang/go3p.  When I search the go installation directory itself there is nothing named mux or gorilla.  The docs don't say anything about where go get installs packages.

What does go get actually do?

Thanks.

Dave Cheney

unread,
Oct 25, 2013, 4:25:07 PM10/25/13
to Dean Schulze, golang-nuts
go get installs packages to the first component of $GOPATH

if you

export GOPATH=$HOME/src/golang/go3p

then go get github.com/gorilla/mux

will result in the source being checked out into

$HOME/src/golang/go3p/src/github.com/gorilla.mux
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Justin Wilson

unread,
Oct 25, 2013, 4:28:15 PM10/25/13
to golan...@googlegroups.com
Have you searched for files, within those packages, on your disk to see where they did get installed?
Doing anything like `sudo go get...`??

Dean Schulze

unread,
Oct 25, 2013, 4:34:43 PM10/25/13
to Dave Cheney, golang-nuts

Turns out I have to go3p/ directories. It got installed in the one on
the GOPATH as you said.

It would be good to include in the docs and the "go get --help" where
"go get" actually installs things. It currently doesn't say that it
installs packages in the first component of the GOPATH.

Benjamin Measures

unread,
Oct 25, 2013, 5:32:39 PM10/25/13
to golan...@googlegroups.com, Dave Cheney
On Friday, 25 October 2013 21:34:43 UTC+1, Dean Schulze wrote:
It would be good to include in the docs and the "go get --help" where
"go get" actually installs things.  It currently doesn't say that it
installs packages in the first component of the GOPATH.

It does mention 'go help packages' and 'go help remote', both of which explain paths more detail (and also suggest 'go help gopath').

Admittedly though, a quick "new packages are always downloaded into the first directory in the [GOPATH] list" could be repeated (a third time) here.

Dean Schulze

unread,
Oct 26, 2013, 1:41:54 AM10/26/13
to golan...@googlegroups.com

The "go help packages" isn't any help at all in determining where a package will be installed.  I would expect to find what "go get" does and where it does it in "go get --help"

Help is sometimes used to refresh what we already know, but a lot of us don't already know it.   The help system should be intuitive.  I would expect "go get --help" to explain what "go get" does.
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/WJJuQJOM-nQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages