aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modget/get.go
diff options
context:
space:
mode:
authorwitchard <witchard@hotmail.co.uk>2021-03-02 21:16:24 +0000
committerJay Conrod <jayconrod@google.com>2021-03-02 21:49:08 +0000
commit312fd9937d6e8675a166fe60df77c1c24015a369 (patch)
tree595884827bea2c20d4f20d8fbce3b71ffdf10516 /src/cmd/go/internal/modget/get.go
parent2a2f99eefb70a66ecb9560a61b5cf23a5ca02ecb (diff)
downloadgo-312fd9937d6e8675a166fe60df77c1c24015a369.tar.gz
go-312fd9937d6e8675a166fe60df77c1c24015a369.zip
cmd/go: remove -insecure flag on go get
Resolves #37519 Change-Id: Iba675a180b0e61b12835cdb6ecd4c6dc61e0605c GitHub-Last-Rev: aa018af6f8fc7f0b829820e831ad96734adcb8d0 GitHub-Pull-Request: golang/go#44724 Reviewed-on: https://go-review.googlesource.com/c/go/+/297709 Trust: Jay Conrod <jayconrod@google.com> Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modget/get.go')
-rw-r--r--src/cmd/go/internal/modget/get.go30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go
index b875a46d81..9340a582e5 100644
--- a/src/cmd/go/internal/modget/get.go
+++ b/src/cmd/go/internal/modget/get.go
@@ -37,7 +37,6 @@ import (
"sync"
"cmd/go/internal/base"
- "cmd/go/internal/cfg"
"cmd/go/internal/imports"
"cmd/go/internal/load"
"cmd/go/internal/modload"
@@ -53,7 +52,7 @@ import (
var CmdGet = &base.Command{
// Note: -d -u are listed explicitly because they are the most common get flags.
// Do not send CLs removing them because they're covered by [get flags].
- UsageLine: "go get [-d] [-t] [-u] [-v] [-insecure] [build flags] [packages]",
+ UsageLine: "go get [-d] [-t] [-u] [-v] [build flags] [packages]",
Short: "add dependencies to current module and install them",
Long: `
Get resolves its command-line arguments to packages at specific module versions,
@@ -99,14 +98,6 @@ but changes the default to select patch releases.
When the -t and -u flags are used together, get will update
test dependencies as well.
-The -insecure flag permits fetching from repositories and resolving
-custom domains using insecure schemes such as HTTP, and also bypassess
-module sum validation using the checksum database. Use with caution.
-This flag is deprecated and will be removed in a future version of go.
-To permit the use of insecure schemes, use the GOINSECURE environment
-variable instead. To bypass module sum validation, use GOPRIVATE or
-GONOSUMDB. See 'go help environment' for details.
-
The -d flag instructs get not to build or install packages. get will only
update go.mod and download source code needed to build packages.
@@ -227,13 +218,13 @@ variable for future go command invocations.
}
var (
- getD = CmdGet.Flag.Bool("d", false, "")
- getF = CmdGet.Flag.Bool("f", false, "")
- getFix = CmdGet.Flag.Bool("fix", false, "")
- getM = CmdGet.Flag.Bool("m", false, "")
- getT = CmdGet.Flag.Bool("t", false, "")
- getU upgradeFlag
- // -insecure is cfg.Insecure
+ getD = CmdGet.Flag.Bool("d", false, "")
+ getF = CmdGet.Flag.Bool("f", false, "")
+ getFix = CmdGet.Flag.Bool("fix", false, "")
+ getM = CmdGet.Flag.Bool("m", false, "")
+ getT = CmdGet.Flag.Bool("t", false, "")
+ getU upgradeFlag
+ getInsecure = CmdGet.Flag.Bool("insecure", false, "")
// -v is cfg.BuildV
)
@@ -264,7 +255,6 @@ func (v *upgradeFlag) String() string { return "" }
func init() {
work.AddBuildFlags(CmdGet, work.OmitModFlag)
CmdGet.Run = runGet // break init loop
- CmdGet.Flag.BoolVar(&cfg.Insecure, "insecure", cfg.Insecure, "")
CmdGet.Flag.Var(&getU, "u", "")
}
@@ -284,8 +274,8 @@ 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")
+ if *getInsecure {
+ base.Fatalf("go get: -insecure flag is no longer supported; use GOINSECURE instead")
}
load.ModResolveTests = *getT