Skip to content

Commit f811663

Browse files
author
Bryan C. Mills
committed
cmd/go: test more commands in mod_build_info_error
For #26909 For #41688 Change-Id: I22f28d426ce499fce6f0f1295dbde425998042aa Reviewed-on: https://go-review.googlesource.com/c/go/+/258219 Trust: Bryan C. Mills <bcmills@google.com> Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
1 parent bb9b319 commit f811663

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# This test verifies that line numbers are included in module import errors.
22
# Verifies golang.org/issue/34393.
33

4-
go list -e -deps -f '{{with .Error}}{{.Pos}}: {{.Err}}{{end}}' ./main
5-
stdout 'bad[/\\]bad.go:3:8: malformed import path "🐧.example.com/string": invalid char ''🐧'''
4+
go list -e -mod=mod -deps -f '{{with .Error}}{{.Pos}}: {{.Err}}{{end}}' ./main
5+
stdout '^bad[/\\]bad.go:3:8: malformed import path "🐧.example.com/string": invalid char ''🐧''$'
6+
7+
# TODO(#26909): This should include an import stack.
8+
# (Today it includes only a file and line.)
9+
! go build ./main
10+
stderr '^bad[/\\]bad.go:3:8: malformed import path "🐧.example.com/string": invalid char ''🐧''$'
11+
12+
# TODO(#41688): This should include a file and line, and report the reason for the error..
13+
# (Today it includes only an import stack, and does not indicate the actual problem.)
14+
! go get -d ./main
15+
stderr '^m/main imports\n\tm/bad imports\n\t🐧.example.com/string: import missing$'
16+
617

718
-- go.mod --
819
module m

0 commit comments

Comments
 (0)