]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modcmd: correctly filter out main modules in verify
authorMichael Matloob <matloob@golang.org>
Tue, 20 Feb 2024 21:13:33 +0000 (16:13 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 21 Feb 2024 16:56:35 +0000 (16:56 +0000)
commit3f60da7944352d7f2d4a04830c0612457643016c
tree5f6f27027fc1c241dec45b2cb51c66455371e6d4
parent3580c212c2e3276077540afdab3478a7336d698b
cmd/go/internal/modcmd: correctly filter out main modules in verify

This change fixes a bug where we incorrectly filtered out the main
modules from the beginning of the build list before verifying them. We
made the assumption that the first MainModules.Len() entries of the
build list were the main modules, but now it can contain the go and
toolchain version entries, so removing the first MainModules.Len()
entries could leave main module names in the build list if any of
their names sorted after the string 'go'.

Fixes #62663

Change-Id: I35ab6857a556f58d306303322afe24c48fc8b38f
Reviewed-on: https://go-review.googlesource.com/c/go/+/565378
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/modcmd/verify.go
src/cmd/go/testdata/script/mod_verify_work.txt [new file with mode: 0644]