Commit d72dce87 authored by Jay Conrod's avatar Jay Conrod

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 <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
parent a253b38d
# '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"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment