cmd/go/internal/mvs: prune spurious dependencies in Downgrade

Previously, mvs.Downgrade could introduce spurious dependencies if the
downgrade computed for one module lands on a “hidden” version (such as
a pseudo-version) due to a requirement introduced by the downgrade for
another module.

To eliminate those spurious dependencies, we can add one more call to
BuildList to recompute the “actual” downgraded versions, and then
including only those actual versions in the final call to BuildList.

For #36460

Change-Id: Icc6b54aa004907221b2bcbbae74598b0e4100776
Trust: Bryan C. Mills <>
Run-TryBot: Bryan C. Mills <>
TryBot-Result: Go Bot <>
Reviewed-by: Michael Matloob <>
3 files changed
tree: 962ddb489449a720968b070ed207d21529748a85
  1. .gitattributes
  2. .github/
  3. .gitignore
  11. api/
  12. codereview.cfg
  13. doc/
  14. favicon.ico
  15. lib/
  16. misc/
  17. robots.txt
  18. src/
  19. test/

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at There is a mirror of the repository at

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at

After downloading a binary release, visit for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit for source installation instructions.


Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at

Note that the Go project uses the issue tracker for bug reports and proposals only. See for a list of places to ask questions about the Go language.