From 7a2c9b40df60189ba165933ef022f9948773f478 Mon Sep 17 00:00:00 2001 From: witchard Date: Thu, 24 Sep 2020 18:10:40 +0100 Subject: [PATCH 1/3] cmd/go/internal/get: improve -insecure deprecation docs Updates #37519 --- src/cmd/go/alldocs.go | 15 ++++++++------- src/cmd/go/internal/get/get.go | 4 ++-- src/cmd/go/internal/modget/get.go | 11 ++++++----- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 4bc87008ffbeb7..d949f6012ad9b4 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -664,11 +664,12 @@ // 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 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 GOINSECURE environment variable should be used instead, since it +// provides control over which modules may be retrieved using an insecure +// scheme. Unlike the -insecure flag, GOINSECURE does not disable module +// sum validation using the checksum database. The GOPRIVATE or GONOSUMDB +// environment variable may be used instead. See 'go help environment' +// for details. // // The second step is to download (if needed), build, and install // the named packages. @@ -2214,8 +2215,8 @@ // 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 is usually a better alternative, since -// it provides control over which modules may be retrieved using an insecure +// The GOINSECURE environment variable should be used instead, since it +// provides control over which modules 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 diff --git a/src/cmd/go/internal/get/get.go b/src/cmd/go/internal/get/get.go index ed2786879c4660..3ce4c26456a7dc 100644 --- a/src/cmd/go/internal/get/get.go +++ b/src/cmd/go/internal/get/get.go @@ -46,8 +46,8 @@ 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 is usually a better alternative, since -it provides control over which modules may be retrieved using an insecure +The GOINSECURE environment variable should be used instead, since it +provides control over which modules 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 diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go index f1cf8b17a8a641..70bef7366f83d3 100644 --- a/src/cmd/go/internal/modget/get.go +++ b/src/cmd/go/internal/modget/get.go @@ -117,11 +117,12 @@ this automatically as well. 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 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 GOINSECURE environment variable should be used instead, since it +provides control over which modules may be retrieved using an insecure +scheme. Unlike the -insecure flag, GOINSECURE does not disable module +sum validation using the checksum database. The GOPRIVATE or GONOSUMDB +environment variable may be used instead. See 'go help environment' +for details. The second step is to download (if needed), build, and install the named packages. From 3775614ddfb43cf97118e2f436c227f8a0c9046a Mon Sep 17 00:00:00 2001 From: witchard Date: Fri, 25 Sep 2020 13:22:47 +0100 Subject: [PATCH 2/3] Updates follwing review. --- doc/go1.16.html | 13 +++++++------ src/cmd/go/alldocs.go | 14 ++++++-------- src/cmd/go/internal/get/get.go | 2 +- src/cmd/go/internal/modget/get.go | 12 +++++------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/doc/go1.16.html b/doc/go1.16.html index 3164acbb6dc85c..f07550a394783e 100644 --- a/doc/go1.16.html +++ b/doc/go1.16.html @@ -87,12 +87,13 @@

go test

The go get -insecure flag is - deprecated and will be removed in a future version. The GOINSECURE - environment variable should be used instead, since it provides control - over which modules may be retrieved using an insecure scheme. Unlike the - -insecure flag, GOINSECURE does not disable module - sum validation using the checksum database. The GOPRIVATE or - GONOSUMDB environment variables may be used instead. + deprecated and will be removed in a future version. This 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. To permit the use of insecure schemes, use the + GOINSECURE environment variable instead. To disable module + sum validation, use GOPRIVATE or GONOSUMDB. + See go help environment for details.

The all pattern

diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index d949f6012ad9b4..f48ddabce1af50 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -662,14 +662,12 @@ // this automatically as well. // // The -insecure flag permits fetching from repositories and resolving -// custom domains using insecure schemes such as HTTP. Use with caution. +// 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. -// The GOINSECURE environment variable should be used instead, since it -// provides control over which modules may be retrieved using an insecure -// scheme. Unlike the -insecure flag, GOINSECURE does not disable module -// sum validation using the checksum database. The GOPRIVATE or GONOSUMDB -// environment variable may be used instead. See 'go help environment' -// for details. +// To permit the use of insecure schemes, use the GOINSECURE environment +// variable instead. To disable module sum validation, use GOPRIVATE or +// GONOSUMDB. See 'go help environment' for details. // // The second step is to download (if needed), build, and install // the named packages. @@ -2216,7 +2214,7 @@ // 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 modules may be retrieved using an insecure +// 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 diff --git a/src/cmd/go/internal/get/get.go b/src/cmd/go/internal/get/get.go index 3ce4c26456a7dc..268962eca8f69b 100644 --- a/src/cmd/go/internal/get/get.go +++ b/src/cmd/go/internal/get/get.go @@ -47,7 +47,7 @@ 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 modules may be retrieved using an insecure +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 diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go index 70bef7366f83d3..193d94019b6186 100644 --- a/src/cmd/go/internal/modget/get.go +++ b/src/cmd/go/internal/modget/get.go @@ -115,14 +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. +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. -The GOINSECURE environment variable should be used instead, since it -provides control over which modules may be retrieved using an insecure -scheme. Unlike the -insecure flag, GOINSECURE does not disable module -sum validation using the checksum database. The GOPRIVATE or GONOSUMDB -environment variable may be used instead. See 'go help environment' -for details. +To permit the use of insecure schemes, use the GOINSECURE environment +variable instead. To disable module sum validation, use GOPRIVATE or +GONOSUMDB. See 'go help environment' for details. The second step is to download (if needed), build, and install the named packages. From db6d3c835bdf867a0b18f115276210e3a05902ed Mon Sep 17 00:00:00 2001 From: witchard Date: Fri, 25 Sep 2020 15:08:37 +0100 Subject: [PATCH 3/3] Further wording improvements. --- doc/go1.16.html | 2 +- src/cmd/go/alldocs.go | 2 +- src/cmd/go/internal/modget/get.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/go1.16.html b/doc/go1.16.html index f07550a394783e..f7e40ceb326718 100644 --- a/doc/go1.16.html +++ b/doc/go1.16.html @@ -91,7 +91,7 @@

go test

fetching from repositories and resolving custom domains using insecure schemes such as HTTP, and also bypassess module sum validation using the checksum database. To permit the use of insecure schemes, use the - GOINSECURE environment variable instead. To disable module + GOINSECURE environment variable instead. To bypass module sum validation, use GOPRIVATE or GONOSUMDB. See go help environment for details.

diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index f48ddabce1af50..44077ca449cc79 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -666,7 +666,7 @@ // 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 disable module sum validation, use GOPRIVATE or +// variable instead. To bypass module sum validation, use GOPRIVATE or // GONOSUMDB. See 'go help environment' for details. // // The second step is to download (if needed), build, and install diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go index 193d94019b6186..ea0e99af7d437c 100644 --- a/src/cmd/go/internal/modget/get.go +++ b/src/cmd/go/internal/modget/get.go @@ -119,7 +119,7 @@ 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 disable module sum validation, use GOPRIVATE or +variable instead. To bypass module sum validation, use GOPRIVATE or GONOSUMDB. See 'go help environment' for details. The second step is to download (if needed), build, and install