...

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

Documentation: cmd/go/testdata/script

     1env GO111MODULE=off
     2
     3# Issue 36173. Verify that "go vet" prints line numbers on load errors.
     4
     5! go vet a/a.go
     6stderr '^package command-line-arguments\n\ta[/\\]a.go:5:3: use of internal package'
     7
     8! go vet a/a_test.go
     9stderr '^package command-line-arguments \(test\)\n\ta[/\\]a_test.go:4:3: use of internal package'
    10
    11! go vet a
    12stderr '^package a\n\ta[/\\]a.go:5:3: use of internal package'
    13
    14go vet b/b.go
    15! stderr 'use of internal package'
    16
    17! go vet b/b_test.go
    18stderr '^package command-line-arguments \(test\)\n\tb[/\\]b_test.go:4:3: use of internal package'
    19
    20! go vet depends-on-a/depends-on-a.go
    21stderr '^package command-line-arguments\n\timports a\n\ta[/\\]a.go:5:3: use of internal package'
    22
    23! go vet depends-on-a/depends-on-a_test.go
    24stderr '^package command-line-arguments \(test\)\n\timports a\n\ta[/\\]a.go:5:3: use of internal package a/x/internal/y not allowed'
    25
    26! go vet depends-on-a
    27stderr '^package depends-on-a\n\timports a\n\ta[/\\]a.go:5:3: use of internal package'
    28
    29-- a/a.go --
    30// A package with bad imports in both src and test
    31package a
    32
    33import (
    34  _ "a/x/internal/y"
    35)
    36
    37-- a/a_test.go --
    38package a
    39
    40import (
    41  _ "a/x/internal/y"
    42)
    43
    44-- b/b.go --
    45// A package with a bad import in test only
    46package b
    47
    48-- b/b_test.go --
    49package b
    50
    51import (
    52  _ "a/x/internal/y"
    53)
    54
    55-- depends-on-a/depends-on-a.go --
    56// A package that depends on a package with a bad import
    57package depends
    58
    59import (
    60  _ "a"
    61)
    62
    63-- depends-on-a/depends-on-a_test.go --
    64package depends
    65
    66import (
    67  _ "a"
    68)
    69
    70-- a/x/internal/y/y.go --
    71package y

View as plain text