From 1d4d7825a70168492e440af59556bfd6734fa883 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 10 Jan 2020 09:37:32 -0500 Subject: [PATCH] cmd/go/internal/modload: fix an erroneous comment about the test repo Updates #36489 Change-Id: I1ca215ba0a64a31d662134385b8be46bb4ba4434 Reviewed-on: https://go-review.googlesource.com/c/go/+/214282 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Dmitri Shuralyov Reviewed-by: Jay Conrod --- src/cmd/go/internal/modload/query_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cmd/go/internal/modload/query_test.go b/src/cmd/go/internal/modload/query_test.go index bad34f088d..15470e2685 100644 --- a/src/cmd/go/internal/modload/query_test.go +++ b/src/cmd/go/internal/modload/query_test.go @@ -163,10 +163,14 @@ var queryTests = []struct { {path: queryRepoV2, query: "v2.6.0-pre1", vers: "v2.6.0-pre1"}, {path: queryRepoV2, query: "latest", vers: "v2.5.5"}, - // e0cf3de987e6 is the latest commit on the master branch, and it's actually - // v1.19.10-pre1, not anything resembling v3: attempting to query it as such - // should fail. + // Commit e0cf3de987e6 is actually v1.19.10-pre1, not anything resembling v3, + // and it has a go.mod file with a non-v3 module path. Attempting to query it + // as the v3 module should fail. {path: queryRepoV3, query: "e0cf3de987e6", err: `vcs-test.golang.org/git/querytest.git/v3@v3.0.0-20180704024501-e0cf3de987e6: invalid version: go.mod has non-.../v3 module path "vcs-test.golang.org/git/querytest.git" (and .../v3/go.mod does not exist) at revision e0cf3de987e6`}, + + // The querytest repo does not have any commits tagged with major version 3, + // and the latest commit in the repo has a go.mod file specifying a non-v3 path. + // That should prevent us from resolving any version for the /v3 path. {path: queryRepoV3, query: "latest", err: `no matching versions for query "latest"`}, {path: emptyRepo, query: "latest", vers: "v0.0.0-20180704023549-7bb914627242"},