go install puts my library .a file in the local directory instead of first component of GOPATH

54 views
Skip to first unread message

Dean Schulze

unread,
Sep 6, 2020, 3:14:26 PM9/6/20
to golang-nuts
I have a library package like this:

└── src
    └── datepackage
        └── dateutil.go

My GOPATH is set like this:

/home/dean/src/golang/go3p:<CURRENT_DIR>

where /home/dean/src/golang/go3p is where go get installs packages and <CURRENT_DIR> is the directory above my src/ directory.

When I execute go install datepackage I get

.
├── pkg
│   └── linux_amd64
│       └── datepackage.a
└── src
    └── datepackage
        └── dateutil.go

I've also tried this with the components of the GOPATH reversed but get the same results.  The go install command should be installing this package where go get would install it (in the first component of my GOPATH), or so I've been lead to believe.

Does go install only install to the PWD?  It seems to be ignoring the GOPATH.

Jan Mercl

unread,
Sep 6, 2020, 3:37:29 PM9/6/20
to Dean Schulze, golang-nuts
On Sun, Sep 6, 2020 at 9:15 PM Dean Schulze <dean.w....@gmail.com> wrote:

> When I execute go install datepackage I get

This is may or may not be the cause, but please note that import paths
without a dot, like the one quoted above, are reserved
(https://github.com/golang/go/issues/32819#issuecomment-566671328) for
the stdlib and the toolchain, but the documentation has not yet been
updated.
Reply all
Reply to author
Forward
0 new messages