Skip to content

Commit d72dce8

Browse files
author
Jay Conrod
committed
cmd/go: test that 'go list -e -mod=readonly' reports errors correctly
This issue was fixed by earlier improvements to error handling when loading modules. Fixes #34829 Change-Id: I4cf4e182a7381f8b5c359179d90bd02491ea7911 Reviewed-on: https://go-review.googlesource.com/c/go/+/209037 Run-TryBot: Jay Conrod <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent a253b38 commit d72dce8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 'go list -mod=readonly -e should attribute errors
2+
# to individual missing packages.
3+
# Verifies golang.org/issue/34829.
4+
go list -mod=readonly -e -deps -f '{{if .Error}}{{.ImportPath}}: {{.Error}}{{end}}' .
5+
stdout 'example.com/missing: use.go:3:8: import lookup disabled by -mod=readonly'
6+
7+
-- go.mod --
8+
module example.com/m
9+
10+
go 1.14
11+
12+
-- use.go --
13+
package use
14+
15+
import _ "example.com/missing"

0 commit comments

Comments
 (0)