On Thu, Sep 5, 2019 at 10:18 PM Jan Mercl <0xj...@gmail.com> wrote:
> `go get` should do just one thing and do it well. Automagically
> adjusting `go.mod` if one is found in the current directory (or in any
> of its parents) when outside $GOPATH is IMO neither of that. Or it
> should be enabled by a flag, like -um (update go.mod) or this is maybe
> a job for some `go mod foo` command, not `go get`.

A-ha, I think I understand the problem: 'go get' can be used for two
unrelated purposes:
1) to add/update dependencies in the current Go module
2) to install a program globally: 'go get golang.org/x/lint/golint'
produces ~/go/bin/golint

One normally wants to perform (2) from anywhere: like 'apt-get install
...' (or perhaps 'npm install -g ...'), it doesn't matter what the
current directory is. But if the current directory happens to be
inside a module, the user inadvertently also performed (1).

If this is the case, it seems an issue worth addressing.
However, I have only a basic understanding of go commands and modules.
I might miss important details.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAMXRBmi_Gpa9_DrmDXP8NKNP7YR2xi-ZSxuRGKcdqHbidZytcQ%40mail.gmail.com.

Reply via email to