[go] cmd/go: Fix for #64007 - For Too old go workspace against local go or go module - verbose modified to use go work use or upgrading the installed golang version

16 views
Skip to first unread message

raghvender sundarjee (Gerrit)

unread,
Nov 15, 2023, 3:15:51 PM11/15/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

raghvender sundarjee has uploaded this change for review.

View Change

cmd/go: Fix for #64007 - For Too old  go workspace against local go or go module - verbose modified to use go work use or upgrading the installed golang version

Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go
index f4f4a68..4edddc2 100644
--- a/src/cmd/go/internal/modload/init.go
+++ b/src/cmd/go/internal/modload/init.go
@@ -1001,7 +1001,7 @@
}

func errWorkTooOld(gomod string, wf *modfile.WorkFile, goVers string) error {
- return fmt.Errorf("module %s listed in go.work file requires go >= %s, but go.work lists go %s; to update it:\n\tgo work use",
+ return fmt.Errorf("module %s listed in go.work file requires go >= %s, but go.work lists go %s; Check if GOSUMDB, GOPRIVATE and GOPROXY are set and to update it:\n\tgo work use\nOtherwise\n\tUpgrate to go %[2]s - Download and install with PATH updated accordingly",
base.ShortPath(filepath.Dir(gomod)), goVers, gover.FromGoWork(wf))
}

diff --git a/src/cmd/go/testdata/script/mod_goline_too_new.txt b/src/cmd/go/testdata/script/mod_goline_too_new.txt
index 6d26679..34a3ca3 100644
--- a/src/cmd/go/testdata/script/mod_goline_too_new.txt
+++ b/src/cmd/go/testdata/script/mod_goline_too_new.txt
@@ -8,7 +8,7 @@
# go.mod referenced from go.work too new
cp go.work.old go.work
! go build .
-stderr '^go: module . listed in go.work file requires go >= 1.99999, but go.work lists go 1.10; to update it:\n\tgo work use$'
+stderr '^go: module . listed in go.work file requires go >= 1.99999, but go.work lists go 1.10; Check if GOSUMDB, GOPRIVATE and GOPROXY are set and to update it:\n\tgo work use\nOtherwise\n\tUpgrate to go 1.99999 - Download and install with PATH updated accordingly$'

! go work sync
stderr '^go: cannot load module . listed in go.work file: go.mod requires go >= 1.99999 \(running go 1\..+\)$'
diff --git a/src/cmd/go/testdata/script/work_goline_order.txt b/src/cmd/go/testdata/script/work_goline_order.txt
index fe1cddb..f604db0 100644
--- a/src/cmd/go/testdata/script/work_goline_order.txt
+++ b/src/cmd/go/testdata/script/work_goline_order.txt
@@ -7,7 +7,7 @@
env TESTGO_VERSION_SWITCH=switch
cp go.work go.work.orig
! go list
-stderr '^go: module . listed in go.work file requires go >= 1.21.2, but go.work lists go 1.21.1; to update it:\n\tgo work use$'
+stderr '^go: module . listed in go.work file requires go >= 1.21.2, but go.work lists go 1.21.1; Check if GOSUMDB, GOPRIVATE and GOPROXY are set and to update it:\n\tgo work use\nOtherwise\n\tUpgrate to go 1.21.2 - Download and install with PATH updated accordingly$'
go work use
go list

@@ -16,7 +16,7 @@
env TESTGO_VERSION_SWITCH=switch
cp go.work.orig go.work
! go list
-stderr '^go: module . listed in go.work file requires go >= 1.21.2, but go.work lists go 1.21.1; to update it:\n\tgo work use$'
+stderr '^go: module . listed in go.work file requires go >= 1.21.2, but go.work lists go 1.21.1; Check if GOSUMDB, GOPRIVATE and GOPROXY are set and to update it:\n\tgo work use\nOtherwise\n\tUpgrate to go 1.21.2 - Download and install with PATH updated accordingly$'

# go work use fixes the problem.
go work use

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 1
Gerrit-Owner: raghvender sundarjee <raghv...@gmail.com>

raghvender sundarjee (Gerrit)

unread,
Nov 15, 2023, 3:22:39 PM11/15/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

raghvender sundarjee uploaded patch set #2 to this change.

View Change

cmd/go: "go work use" doesn't clearly indicate when download fails


Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 2
Gerrit-Owner: raghvender sundarjee <raghv...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: raghvender sundarjee <raghv...@gmail.com>

raghvender sundarjee (Gerrit)

unread,
Nov 15, 2023, 3:24:15 PM11/15/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

raghvender sundarjee uploaded patch set #3 to this change.

View Change

cmd/go: "go work use" doesn't clearly indicate when download fails

The change is to fix : For Too old  go workspace against local go or go module - verbose modified to use go work use or upgrading the installed golang.


Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 3

raghvender sundarjee (Gerrit)

unread,
Nov 16, 2023, 8:44:44 AM11/16/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

raghvender sundarjee uploaded patch set #4 to this change.

View Change

cmd/go: Fix for #64007 - For Too old  go workspace against local go or go module - verbose modified to use go work use or upgrading the installed golang version


Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 4

raghvender sundarjee (Gerrit)

unread,
Nov 16, 2023, 8:51:43 AM11/16/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

raghvender sundarjee uploaded patch set #5 to this change.

View Change

cmd/go: Fix for #64007 - For Too old  go workspace against local go or go module - verbose modified to use go work use or upgrading the installed golang version

Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 5

qiulaidongfeng (Gerrit)

unread,
Nov 17, 2023, 8:48:21 PM11/17/23
to raghvender sundarjee, goph...@pubsubhelper.golang.org, triciu...@appspot.gserviceaccount.com, Bryan Mills, Russ Cox, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

View Change

1 comment:

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 5
Gerrit-Owner: raghvender sundarjee <raghv...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: raghvender sundarjee <raghv...@gmail.com>
Gerrit-Comment-Date: Sat, 18 Nov 2023 01:48:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

raghvender sundarjee (Gerrit)

unread,
Nov 17, 2023, 9:25:13 PM11/17/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

raghvender sundarjee uploaded patch set #6 to this change.

View Change

cmd/go: Provided actionable messages with options  when go workspace is old (Version) against installed golang or modules under that go workspace.

Currently when go workspace is older than modules or go version, it is recommended to do go work use to updated the local toolchain matching go version or modules under that workspace. However go work use fails based on toolchain download failures caused by combination of these 3 environment variables - GOSUMDB, GOPRIVATE and GOPROXY.

The recommendation message says this - either set these variables correct so that go work use works or if the issue still persists kindly upgrade the installed go lang version matching to modules and set it against go workspace.

fixes : https://github.com/golang/go/issues/64007


Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 6

raghvender sundarjee (Gerrit)

unread,
Nov 17, 2023, 9:25:42 PM11/17/23
to goph...@pubsubhelper.golang.org, qiulaidongfeng, triciu...@appspot.gserviceaccount.com, Bryan Mills, Russ Cox, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, qiulaidongfeng.

View Change

1 comment:

  • Commit Message:

    • Done

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 6
Gerrit-Owner: raghvender sundarjee <raghv...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Sat, 18 Nov 2023 02:25:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

raghvender sundarjee (Gerrit)

unread,
Dec 5, 2023, 10:56:23 AM12/5/23
to goph...@pubsubhelper.golang.org, qiulaidongfeng, triciu...@appspot.gserviceaccount.com, Bryan Mills, Russ Cox, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, qiulaidongfeng.

View Change

1 comment:

  • Commit Message:

    • Patch Set #5, Line 7: cmd/go: Fix for #64007 - For Too old go workspace against local go or go module - verbose modified to use go work use or upgrading the installed golang version

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 6
Gerrit-Owner: raghvender sundarjee <raghv...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Tue, 05 Dec 2023 15:56:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: raghvender sundarjee <raghv...@gmail.com>
Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

qiulaidongfeng (Gerrit)

unread,
Dec 5, 2023, 5:52:16 PM12/5/23
to raghvender sundarjee, goph...@pubsubhelper.golang.org, triciu...@appspot.gserviceaccount.com, Bryan Mills, Russ Cox, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

View Change

1 comment:

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 6
Gerrit-Owner: raghvender sundarjee <raghv...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: raghvender sundarjee <raghv...@gmail.com>
Gerrit-Comment-Date: Tue, 05 Dec 2023 22:52:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

raghvender sundarjee (Gerrit)

unread,
Dec 5, 2023, 9:41:47 PM12/5/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

raghvender sundarjee uploaded patch set #7 to this change.

View Change

cmd/go: Provided actionable messages with options  when go workspace is old (Version) against installed golang or modules under that go workspace.

Currently when go workspace is older than modules or go version, it is recommended to do go work use to updated the local toolchain matching go version or modules under that workspace. However go work use fails based on toolchain download failures caused by combination of these 3 environment variables - GOSUMDB, GOPRIVATE and GOPROXY.

The recommendation message says this - either set these variables correct so that go work use works or if the issue still persists kindly upgrade the installed go lang version matching to modules and set it against go workspace.

fixes #64007


Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 7

raghvender sundarjee (Gerrit)

unread,
Dec 5, 2023, 9:52:24 PM12/5/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

raghvender sundarjee uploaded patch set #8 to this change.

View Change

cmd/go: Provide actionable message when go workspace or modules or installed go are not in aligned versions.

Currently when go workspace is older than modules or go version, it is recommended to do go work use to update the local toolchain matching go version or modules under that workspace. However go work use fails based on toolchain download failures caused by combination of these 3 environment variables - GOSUMDB, GOPRIVATE and GOPROXY.

The current recommendation message is rephrased as - either set these variables correct so that go work use works with go version upgraded or if the issue still persists kindly upgrade the installed go version matching modules and set it against go workspace.


fixes #64007

Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 8

raghvender sundarjee (Gerrit)

unread,
Dec 5, 2023, 9:52:41 PM12/5/23
to goph...@pubsubhelper.golang.org, qiulaidongfeng, triciu...@appspot.gserviceaccount.com, Bryan Mills, Russ Cox, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, qiulaidongfeng.

View Change

1 comment:

  • Commit Message:

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 8
Gerrit-Owner: raghvender sundarjee <raghv...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Wed, 06 Dec 2023 02:52:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

raghvender sundarjee (Gerrit)

unread,
Dec 5, 2023, 10:27:45 PM12/5/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, qiulaidongfeng.

raghvender sundarjee uploaded patch set #9 to this change.

View Change

cmd/go: Provide actionable message when go workspace or modules or installed go are not in aligned versions.

Currently when go workspace is older than modules or go version, it is recommended to do go work use to update the local toolchain matching go version or modules under that workspace. However go work use fails based on toolchain download failures caused by combination of these 3 environment variables - GOSUMDB, GOPRIVATE and GOPROXY.

The current recommendation message is rephrased as - either set these variables correct so that `go work use` works with go version upgraded or if the issue still persists kindly upgrade the installed go version matching modules and set it against go workspace.

fixes #64007

Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 9

raghvender sundarjee (Gerrit)

unread,
Dec 5, 2023, 10:39:28 PM12/5/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, qiulaidongfeng.

raghvender sundarjee uploaded patch set #10 to this change.

View Change

cmd/go: provide actionable message when go workspace or modules or installed go are not in aligned versions.


Currently when go workspace is older than modules or go version, it is recommended to do go work use to update the local toolchain matching go version or modules under that workspace. However go work use fails based on toolchain download failures caused by combination of these 3 environment variables - GOSUMDB, GOPRIVATE and GOPROXY.

The current recommendation message is rephrased as - either set these variables correct so that `go work use` works with go version upgraded or if the issue still persists kindly upgrade the installed go version matching modules and set it against go workspace.

fixes #64007

Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 10

raghvender sundarjee (Gerrit)

unread,
Dec 5, 2023, 10:40:10 PM12/5/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, qiulaidongfeng.

raghvender sundarjee uploaded patch set #11 to this change.

View Change

cmd/go: provide actionable message when go workspace or modules or installed go are not in aligned versions.

Currently when go workspace is older than modules or go version, it is recommended to do go work use to update the local toolchain matching go version or modules under that workspace. However go work use fails based on toolchain download failures caused by combination of these 3 environment variables - GOSUMDB, GOPRIVATE and GOPROXY.

The current recommendation message is rephrased as - either set these variables correct so that `go work use` works with go version upgraded or if the issue still persists kindly upgrade the installed go version matching modules and set it against go workspace.

Fixes #64007


Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
---
M src/cmd/go/internal/modload/init.go
M src/cmd/go/testdata/script/mod_goline_too_new.txt
M src/cmd/go/testdata/script/work_goline_order.txt
3 files changed, 4 insertions(+), 4 deletions(-)

To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
Gerrit-Change-Number: 542696
Gerrit-PatchSet: 11

qiulaidongfeng (Gerrit)

unread,
Dec 5, 2023, 11:47:42 PM12/5/23
to raghvender sundarjee, goph...@pubsubhelper.golang.org, triciu...@appspot.gserviceaccount.com, Bryan Mills, Russ Cox, golang-co...@googlegroups.com

Attention is currently required from: Bryan Mills, raghvender sundarjee.

Patch set 11:Run-TryBot +1

View Change

    To view, visit change 542696. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I87fc5170f365122d3216cc5d8de35a0f1bb9cec6
    Gerrit-Change-Number: 542696
    Gerrit-PatchSet: 11
    Gerrit-Owner: raghvender sundarjee <raghv...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: raghvender sundarjee <raghv...@gmail.com>
    Gerrit-Comment-Date: Wed, 06 Dec 2023 04:47:36 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Reply all
    Reply to author
    Forward
    0 new messages