aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/build_internal.txt
blob: 6fcc4e02aabd9b676204a5b8df24a1463cf915f3 (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
34
35
36
37
38
39
40
41
42
43
44
# Test internal package errors are handled
go list ./testinternal3
stdout 'testinternal3'

# Test internal cache
env GOPATH=$WORK/gopath/src/testinternal4
! go build p
stderr 'internal'

# Test internal packages outside GOROOT are respected
! go build -v  ./testinternal2
stderr 'testinternal2(\/|\\)p\.go\:3\:8\: use of internal package .*internal/w not allowed'

[gccgo] skip # gccgo does not have GOROOT
! go build -v ./testinternal
stderr 'testinternal(\/|\\)p\.go\:3\:8\: use of internal package net/http/internal not allowed'

-- testinternal/p.go --
package p

import _ "net/http/internal"
-- testinternal2/p.go --
package p

import _ "./x/y/z/internal/w"
-- testinternal2/x/y/z/internal/w/w.go --
package w
-- testinternal3/t.go --
package t

import _ "internal/does-not-exist"
-- testinternal4/src/p/p.go --
package p

import (
	_ "q/internal/x"
	_ "q/j"
)
-- testinternal4/src/q/internal/x/x.go --
package x
-- testinternal4/src/q/j/j.go --
package j

import _ "q/internal/x"