CL 378400 appears to have introduced a regression for modules that contain a v2/go.mod file and not go.mod file at the repo root.
github.com/sacloud/libsacloud at commit b491c1c2c6bd6e18fd0b55ef6770ecd1e66f1419 is one such example.
At that revision, it contains a v2/go.mod file that correctly declares module github.com/sacloud/libsacloud/v2, and no go.mod file whatsoever at the module root. The corresponding v2 pseudo-version should therefore apply only to the v2 module (github.com/sacloud/libsacloud/v2) — it should not also be valid as a +incompatible version for the module at the root of the repo.
Go 1.17 as originally released correctly rejected that version for the repo root. go1.18rc1 does not.
$ export GOPRIVATE=github.com/sacloud/libsacloud
$ go clean -modcache
$ gotip list -m github.com/sacloud/libsacloud@v2.25.2-0.20210930043551-b491c1c2c6bd
github.com/sacloud/libsacloud v2.25.2-0.20210930043551-b491c1c2c6bd+incompatible
$ go clean -modcache
$ go1.17 list -m github.com/sacloud/libsacloud@v2.25.2-0.20210930043551-b491c1c2c6bd
go list -m: github.com/sacloud/libsacloud@v2.25.2-0.20210930043551-b491c1c2c6bd: invalid version: should be v0 or v1, not v2
(Found by @heschi during Go 1.18 pre-release testing.)
CC @matloob
CL 378400 appears to have introduced a regression for modules that contain a
v2/go.modfile and notgo.modfile at the repo root.github.com/sacloud/libsacloudat commitb491c1c2c6bd6e18fd0b55ef6770ecd1e66f1419is one such example.At that revision, it contains a
v2/go.modfile that correctly declaresmodule github.com/sacloud/libsacloud/v2, and nogo.modfile whatsoever at the module root. The correspondingv2pseudo-version should therefore apply only to thev2module (github.com/sacloud/libsacloud/v2) — it should not also be valid as a+incompatibleversion for the module at the root of the repo.Go 1.17 as originally released correctly rejected that version for the repo root.
go1.18rc1does not.(Found by @heschi during Go 1.18 pre-release testing.)
CC @matloob