]> Cypherpunks repositories - gostls13.git/commit
cmd/go: make 'go get' fail with an error when outside a module
authorJay Conrod <jayconrod@google.com>
Fri, 24 Sep 2021 20:26:35 +0000 (13:26 -0700)
committerJay Conrod <jayconrod@google.com>
Tue, 28 Sep 2021 17:19:08 +0000 (17:19 +0000)
commit1c6e50a15200673eb90c817cb6709be5d06cd3f4
tree16f8634352afcd4bb2cac77ad2de4892b59641db
parentff7b04136091f8208352e97c117ca6489ca95a86
cmd/go: make 'go get' fail with an error when outside a module

There's no go.mod file for 'go get' to update, so it has no effect,
other than checking arguments and filling the module cache. That might
be useul in some cases, but it seems better to fail loudly in case the
user hasn't seen the deprecation warning, for example, inside a
script.

For #43684

Change-Id: I6e67c782e3a1cb7046eac5c9df17eda7a31c7bce
Reviewed-on: https://go-review.googlesource.com/c/go/+/352149
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
12 files changed:
src/cmd/go/internal/modget/get.go
src/cmd/go/testdata/script/get_404_meta.txt
src/cmd/go/testdata/script/mod_cache_dir.txt
src/cmd/go/testdata/script/mod_download_insecure_redirect.txt [moved from src/cmd/go/testdata/script/mod_get_insecure_redirect.txt with 65% similarity]
src/cmd/go/testdata/script/mod_download_private_vcs.txt [moved from src/cmd/go/testdata/script/mod_get_private_vcs.txt with 88% similarity]
src/cmd/go/testdata/script/mod_download_too_many_redirects.txt [moved from src/cmd/go/testdata/script/mod_get_too_many_redirects.txt with 69% similarity]
src/cmd/go/testdata/script/mod_get_deprecate_install.txt
src/cmd/go/testdata/script/mod_get_fallback.txt
src/cmd/go/testdata/script/mod_get_go_file.txt
src/cmd/go/testdata/script/mod_getx.txt
src/cmd/go/testdata/script/mod_missing_repo.txt
src/cmd/go/testdata/script/mod_outside.txt