blob: 567d2a9d4ae5470400efd2cb2d24dd449e115b45 [file] [log] [blame]
This test checks a diagnostic for invalid use of internal packages.
This list error changed in Go 1.21.
See TestValidImportCheck_GoPackagesDriver for a test that no diagnostic
is produced when using a GOPACKAGESDRIVER (such as for Bazel).
-- go.mod --
module bad.test
go 1.18
-- assign/internal/secret/secret.go --
package secret
func Hello() {}
-- bad/bad.go --
package bad
import _ "bad.test/assign/internal/secret" //@diag("\"bad.test/assign/internal/secret\"", re"could not import bad.test/assign/internal/secret \\(invalid use of internal package \"bad.test/assign/internal/secret\"\\)"),diag("_", re"use of internal package bad.test/assign/internal/secret not allowed")