diff options
author | witchard <witchard@hotmail.co.uk> | 2020-09-21 19:35:15 +0000 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2020-09-21 21:03:02 +0000 |
commit | 5853b4ee47f41f2d5ea8e63a185b2cfd6e08b98c (patch) | |
tree | af046f78aa09d7856bc8e514e6a952f762022b4f /src/cmd/go/internal/modget/get.go | |
parent | f92c64045f5effd4339749b8ce3b63b88cfef4d4 (diff) | |
download | go-5853b4ee47f41f2d5ea8e63a185b2cfd6e08b98c.tar.gz go-5853b4ee47f41f2d5ea8e63a185b2cfd6e08b98c.zip |
cmd/go/internal/get: warn about -insecure deprecation
Adds deprecation warning for -insecure flag on go get in both modules
and GOPATH mode.
Updates #37519.
Change-Id: Ie2efeeb4a91e6dda92955295969e9715314ae50e
GitHub-Last-Rev: a9ebe21fe067baa12391ad4f9357d8e5b0cf7051
GitHub-Pull-Request: golang/go#41497
Reviewed-on: https://go-review.googlesource.com/c/go/+/255882
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Trust: Michael Matloob <matloob@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modget/get.go')
-rw-r--r-- | src/cmd/go/internal/modget/get.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go index 0c501e3885..f7b5cfaf2e 100644 --- a/src/cmd/go/internal/modget/get.go +++ b/src/cmd/go/internal/modget/get.go @@ -115,9 +115,12 @@ require downgrading other dependencies, and 'go get' does this automatically as well. The -insecure flag permits fetching from repositories and resolving -custom domains using insecure schemes such as HTTP. Use with caution. The -GOINSECURE environment variable is usually a better alternative, since it -provides control over which modules may be retrieved using an insecure scheme. +custom domains using insecure schemes such as HTTP. Use with caution. +This flag is deprecated and will be removed in a future version of go. +The GOINSECURE environment variable is usually a better alternative, since +it provides control over which modules may be retrieved using an insecure +scheme. It should be noted that the -insecure flag also turns the module +checksum validation off. GOINSECURE does not do that, use GONOSUMDB. See 'go help environment' for details. The second step is to download (if needed), build, and install @@ -278,6 +281,9 @@ func runGet(ctx context.Context, cmd *base.Command, args []string) { if *getM { base.Fatalf("go get: -m flag is no longer supported; consider -d to skip building packages") } + if cfg.Insecure { + fmt.Fprintf(os.Stderr, "go get: -insecure flag is deprecated; see 'go help get' for details\n") + } modload.LoadTests = *getT // Do not allow any updating of go.mod until we've applied |