]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modfetch: prune +incompatible versions more aggressively
authorBryan C. Mills <bcmills@google.com>
Mon, 28 Oct 2019 20:32:24 +0000 (16:32 -0400)
committerBryan C. Mills <bcmills@google.com>
Tue, 5 Nov 2019 21:16:50 +0000 (21:16 +0000)
commit14a133fe7791cdad14dc55332a506801fa8ea5f9
tree6888e9a52e9e1d793c26ec1e5259fe84866580a9
parent81559af51a69d9f2c1c45d78efbe3cd7a4b9e3cb
cmd/go/internal/modfetch: prune +incompatible versions more aggressively

codeRepo.Versions previously checked every possible +incompatible
version for a 'go.mod' file. That is wasteful and counterproductive.

It is wasteful because typically, a project will adopt modules at some
major version, after which they will (be required to) use semantic
import paths for future major versions.

It is counterproductive because it causes an accidental
'+incompatible' tag to exist, and no compatible tag can have higher
semantic precedence.

This change prunes out some of the +incompatible versions in
codeRepo.Versions, eliminating the “wasteful” part but not all of the
“counterproductive” part: the extraneous versions can still be fetched
explicitly, and proxies may include them in the @v/list endpoint.

Updates #34165
Updates #34189
Updates #34533

Change-Id: Ifc52c725aa396f7fde2afc727d0d5950acd06946
Reviewed-on: https://go-review.googlesource.com/c/go/+/204439
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modfetch/coderepo.go
src/cmd/go/internal/modfetch/coderepo_test.go
src/cmd/go/internal/modfetch/repo.go