Skip to content

Commit f1c400a

Browse files
author
Jay Conrod
committed
cmd/go: fix broken mod_outside test
Since CL 254369, 'go mod graph' now reports an error when invoked outside a module. This broke the mod_outside test, which expected 'go mod graph' to succeed with no output. Change-Id: Ic30ee68f1f4c4d33795bdf7df70a7631fb9395e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/255017 Trust: Jay Conrod <[email protected]> Run-TryBot: Jay Conrod <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 03875bd commit f1c400a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/cmd/go/testdata/script/mod_outside.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ go clean -n
6969
! stdout .
7070
! stderr .
7171

72-
# 'go mod graph' should not display anything, since there are no active modules.
73-
go mod graph
74-
! stdout .
75-
! stderr .
72+
# 'go mod graph' should fail, since there's no module graph.
73+
! go mod graph
74+
stderr 'cannot find main module'
7675

7776
# 'go mod why' should fail, since there is no main module to depend on anything.
7877
! go mod why -m example.com/version

0 commit comments

Comments
 (0)