aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/work.txt
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2021-07-28 12:32:08 -0400
committerMichael Matloob <matloob@golang.org>2021-07-28 18:15:59 +0000
commit176baafd5b6d968fc0df25b344ffe826e47e6879 (patch)
treeb14f775266b73ae2c0fb7005701ca0631a5f33d1 /src/cmd/go/testdata/script/work.txt
parent288a83dcffef18514e8c01f0ca2053c6be185305 (diff)
downloadgo-176baafd5b6d968fc0df25b344ffe826e47e6879.tar.gz
go-176baafd5b6d968fc0df25b344ffe826e47e6879.zip
[dev.cmdgo] cmd/go: sort roots when joining multiple main module roots
When concatenating multiple main modules' roots we need to resort the list of main module roots. This avoids a panic from unsorted main module roots. This will get better when we have structured module roots. Change-Id: I68fed47b0f3b131ed3dadf45db3c442286a0ced0 Reviewed-on: https://go-review.googlesource.com/c/go/+/338111 Trust: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/testdata/script/work.txt')
-rw-r--r--src/cmd/go/testdata/script/work.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/work.txt b/src/cmd/go/testdata/script/work.txt
index 0d820fffc2..eeaf92eaec 100644
--- a/src/cmd/go/testdata/script/work.txt
+++ b/src/cmd/go/testdata/script/work.txt
@@ -36,6 +36,11 @@ cp go.work.backup go.work
cp go.work.d go.work
go run example.com/d
+# Test that we don't run into "newRequirements called with unsorted roots"
+# panic with unsorted main modules.
+cp go.work.backwards go.work
+go run example.com/d
+
-- go.work.dup --
go 1.17
@@ -109,3 +114,12 @@ import "example.com/b/lib"
func main() {
lib.Hello()
}
+
+-- go.work.backwards --
+go 1.18
+
+directory (
+ d
+ b
+ a
+) \ No newline at end of file