Skip to content

Commit

Permalink
cmd/go: test that 'go list -e -mod=readonly' reports errors correctly
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Jay Conrod committed Dec 5, 2019
1 parent a253b38 commit d72dce8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/cmd/go/testdata/script/mod_list_e_readonly.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 'go list -mod=readonly -e should attribute errors
# to individual missing packages.
# Verifies golang.org/issue/34829.
go list -mod=readonly -e -deps -f '{{if .Error}}{{.ImportPath}}: {{.Error}}{{end}}' .
stdout 'example.com/missing: use.go:3:8: import lookup disabled by -mod=readonly'

-- go.mod --
module example.com/m

go 1.14

-- use.go --
package use

import _ "example.com/missing"

0 comments on commit d72dce8

Please sign in to comment.