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

     1  # Test that errors importing packages are reported on the importing package,
     2  # not the imported package.
     3  
     4  env GO111MODULE=off # simplify vendor layout for test
     5  
     6  go list -e -deps -f '{{.ImportPath}}: {{.Error}}' ./importvendor
     7  stdout 'importvendor: importvendor[\\/]p.go:2:8: vendor/p must be imported as p'
     8  stdout 'vendor/p: <nil>'
     9  
    10  go list -e -deps -f '{{.ImportPath}}: {{.Error}}' ./importinternal
    11  stdout 'importinternal: package importinternal\n\timportinternal[\\/]p.go:2:8: use of internal package other/internal/p not allowed'
    12  stdout 'other/internal/p: <nil>'
    13  -- importvendor/p.go --
    14  package importvendor
    15  import "vendor/p"
    16  -- importinternal/p.go --
    17  package importinternal
    18  import "other/internal/p"
    19  -- other/internal/p/p.go --
    20  package p
    21  -- vendor/p/p.go --
    22  package p

View as plain text