...

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

Documentation: cmd/go/testdata/script

     1# This test verifies that line numbers are included in module import errors.
     2# Verifies golang.org/issue/34393.
     3
     4go list -e -mod=mod -deps -f '{{with .Error}}{{.Pos}}: {{.Err}}{{end}}' ./main
     5stdout '^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
    10stderr '^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.)
    14! go get ./main
    15stderr '^go: m/main imports\n\tm/bad imports\n\tšŸ§.example.com/string: malformed import path "šŸ§.example.com/string": invalid char ''šŸ§''$'
    16
    17
    18-- go.mod --
    19module m
    20
    21go 1.13
    22
    23-- main/main.go --
    24package main
    25
    26import _ "m/bad"
    27
    28func main() {}
    29
    30-- bad/bad.go --
    31package bad
    32
    33import _ "šŸ§.example.com/string"

View as plain text