Re: [go-nuts] Modules + go get

2018-09-10 Thread Scott Cotton
Yes I think defaulting to go get -u without modules is best too.

Because modules allow version compatibility, and so code intended for use 
with modules may not work at the repo HEAD, asking go get to fetch without 
building may be more reliable.

Best,
Scott

On Monday, 10 September 2018 11:00:47 UTC+2, Paul Jolly wrote:
>
> This sort of "global" get/install is being discussed in 
> https://github.com/golang/go/issues/24250 (which will also cover the 
> documentation point). It's marked as "release blocked" for Go 1.12. 
>
> For now, I think the best approach is to: 
>
> GO111MODULE=off go get -u github.com/my/package 
>
> i.e. drop back to GOPATH-mode. You can optionally set GOBIN as you 
> suggest, but not necessary because GOPATH will default to $HOME/go 
>
>
> Paul 
> On Mon, 10 Sep 2018 at 09:41, Caleb Spare > 
> wrote: 
> > 
> > What's the best substitute for "go get my/tool" in a modules world? 
> > 
> > I used to be able to tell my users to set up Go with a GOPATH workspace 
> and then run "go get -u github.com/my/package". I can't find an 
> equivalent workflow now. The closest I can find is 
> > 
> > GOBIN=~/bin GO111MODULES=on go get github.com/my/package@latest 
> > 
> > But this drops go.mod/go.sum files in the current directory, which I 
> don't want. Is there some command to just build and put a binary in a 
> directory without touching any other files (outside the cache)? 
> > 
> > -- 
> > 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/d/optout. 
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Modules + go get

2018-09-10 Thread Paul Jolly
>> GO111MODULE=off go get -u github.com/my/package
>
> Last time I check, if GOPATH is unset and GO111MODULE is on it will download 
> the source code to $HOME/go.

If you saw this behaviour then that is a bug. Or did you mean
GO111MODULE=auto or GO111MODULE is unset (in addition to GOPATH being
unset)?

If you have any repro steps that would be useful.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Modules + go get

2018-09-10 Thread Mhd Shulhan
On Mon, 10 Sep 2018, 16:00 Paul Jolly,  wrote:

>
> GO111MODULE=off go get -u github.com/my/package
>

Last time I check, if GOPATH is unset and GO111MODULE is on it will
download the source code to $HOME/go.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Modules + go get

2018-09-10 Thread Paul Jolly
This sort of "global" get/install is being discussed in
https://github.com/golang/go/issues/24250 (which will also cover the
documentation point). It's marked as "release blocked" for Go 1.12.

For now, I think the best approach is to:

GO111MODULE=off go get -u github.com/my/package

i.e. drop back to GOPATH-mode. You can optionally set GOBIN as you
suggest, but not necessary because GOPATH will default to $HOME/go


Paul
On Mon, 10 Sep 2018 at 09:41, Caleb Spare  wrote:
>
> What's the best substitute for "go get my/tool" in a modules world?
>
> I used to be able to tell my users to set up Go with a GOPATH workspace and 
> then run "go get -u github.com/my/package". I can't find an equivalent 
> workflow now. The closest I can find is
>
> GOBIN=~/bin GO111MODULES=on go get github.com/my/package@latest
>
> But this drops go.mod/go.sum files in the current directory, which I don't 
> want. Is there some command to just build and put a binary in a directory 
> without touching any other files (outside the cache)?
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Modules + go get

2018-09-10 Thread Caleb Spare
What's the best substitute for "go get my/tool" in a modules world?

I used to be able to tell my users to set up Go with a GOPATH workspace and
then run "go get -u github.com/my/package". I can't find an equivalent
workflow now. The closest I can find is

GOBIN=~/bin GO111MODULES=on go get github.com/my/package@latest

But this drops go.mod/go.sum files in the current directory, which I don't
want. Is there some command to just build and put a binary in a directory
without touching any other files (outside the cache)?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.