diff options
Diffstat (limited to 'src/cmd/go/internal/get')
-rw-r--r-- | src/cmd/go/internal/get/get.go | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/cmd/go/internal/get/get.go b/src/cmd/go/internal/get/get.go index 329a2f5eda..10eda1275e 100644 --- a/src/cmd/go/internal/get/get.go +++ b/src/cmd/go/internal/get/get.go @@ -26,7 +26,7 @@ import ( ) var CmdGet = &base.Command{ - UsageLine: "go get [-d] [-f] [-t] [-u] [-v] [-fix] [-insecure] [build flags] [packages]", + UsageLine: "go get [-d] [-f] [-t] [-u] [-v] [-fix] [build flags] [packages]", Short: "download and install packages and dependencies", Long: ` Get downloads the packages named by the import paths, along with their @@ -43,13 +43,6 @@ of the original. The -fix flag instructs get to run the fix tool on the downloaded packages before resolving dependencies or building the code. -The -insecure flag permits fetching from repositories and resolving -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 should be used instead, since it -provides control over which packages may be retrieved using an insecure -scheme. See 'go help environment' for details. - The -t flag instructs get to also download the packages required to build the tests for the specified packages. @@ -105,17 +98,17 @@ Usage: ` + CmdGet.UsageLine + ` } var ( - getD = CmdGet.Flag.Bool("d", false, "") - getF = CmdGet.Flag.Bool("f", false, "") - getT = CmdGet.Flag.Bool("t", false, "") - getU = CmdGet.Flag.Bool("u", false, "") - getFix = CmdGet.Flag.Bool("fix", false, "") + getD = CmdGet.Flag.Bool("d", false, "") + getF = CmdGet.Flag.Bool("f", false, "") + getT = CmdGet.Flag.Bool("t", false, "") + getU = CmdGet.Flag.Bool("u", false, "") + getFix = CmdGet.Flag.Bool("fix", false, "") + getInsecure = CmdGet.Flag.Bool("insecure", false, "") ) func init() { work.AddBuildFlags(CmdGet, work.OmitModFlag|work.OmitModCommonFlags) CmdGet.Run = runGet // break init loop - CmdGet.Flag.BoolVar(&cfg.Insecure, "insecure", cfg.Insecure, "") } func runGet(ctx context.Context, cmd *base.Command, args []string) { @@ -129,8 +122,8 @@ func runGet(ctx context.Context, cmd *base.Command, args []string) { if *getF && !*getU { base.Fatalf("go get: cannot use -f flag without -u") } - 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") } // Disable any prompting for passwords by Git. @@ -435,7 +428,7 @@ func downloadPackage(p *load.Package) error { return fmt.Errorf("%s: invalid import path: %v", p.ImportPath, err) } security := web.SecureOnly - if cfg.Insecure || module.MatchPrefixPatterns(cfg.GOINSECURE, importPrefix) { + if module.MatchPrefixPatterns(cfg.GOINSECURE, importPrefix) { security = web.Insecure } |