]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: ignore disallowed errors when checking for updates
authorJay Conrod <jay@golang.org>
Wed, 29 Jun 2022 01:15:32 +0000 (18:15 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 12 Jul 2022 20:57:09 +0000 (20:57 +0000)
commit27794c4d4a18c61d8c158d253421d72b5a6a8673
treed74eb57b3dd528b984f03d315f5bd318b0b8093f
parentb2b8872c876201eac2d0707276c6999ff3eb185e
cmd/go/internal/modload: ignore disallowed errors when checking for updates

addUpdate calls Query with the query "upgrade". Normally, this returns
the highest release version (or prerelease, etc.) that is higher than
the current version and is not retracted or excluded. If there is no
such version, Query should return the current version. If the current
version is retracted or excluded, then Query currently returns an error.

addUpdate should ignore this error, as it ignores ErrNotExist and
NoMatchingVersionError. For 'go list -m -u', addRetraction is also
called, and that will detect the retraction.

Fixes #53594

Change-Id: I90a2872cdeabf03894acad9e0cbdd7db4a4e269e
Reviewed-on: https://go-review.googlesource.com/c/go/+/414825
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/cmd/go/internal/modload/build.go
src/cmd/go/testdata/mod/example.com_retract_noupgrade_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_retract_noupgrade.txt [new file with mode: 0644]