aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_build_info_err.txt
blob: 4a6ee9e8bb7e9b83c7d350f60d172f9d633f7657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This test verifies that line numbers are included in module import errors.
# Verifies golang.org/issue/34393.

go list -e -mod=mod -deps -f '{{with .Error}}{{.Pos}}: {{.Err}}{{end}}' ./main
stdout '^bad[/\\]bad.go:3:8: malformed import path "🐧.example.com/string": invalid char ''🐧''$'

# TODO(#26909): This should include an import stack.
# (Today it includes only a file and line.)
! go build ./main
stderr '^bad[/\\]bad.go:3:8: malformed import path "🐧.example.com/string": invalid char ''🐧''$'

# TODO(#41688): This should include a file and line, and report the reason for the error..
# (Today it includes only an import stack, and does not indicate the actual problem.)
! go get -d ./main
stderr '^m/main imports\n\tm/bad imports\n\t🐧.example.com/string: import missing$'


-- go.mod --
module m

go 1.13

-- main/main.go --
package main

import _ "m/bad"

func main() {}

-- bad/bad.go --
package bad

import _ "🐧.example.com/string"