1
0
mirror of https://github.com/golang/go synced 2024-11-17 22:14:43 -07:00

cmd/compile: document reserved import paths

Fixes #20708.

Change-Id: I2db450947b64b8b5af3822c7fbcc3e99746ae9d7
Reviewed-on: https://go-review.googlesource.com/87496
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2018-01-11 17:37:16 -08:00
parent c13e0e8cee
commit 8554fd6e7d

View File

@ -1974,6 +1974,11 @@ func addinit(n *Node, init []*Node) *Node {
return n
}
// The linker uses the magic symbol prefixes "go." and "type."
// Avoid potential confusion between import paths and symbols
// by rejecting these reserved imports for now. Also, people
// "can do weird things in GOPATH and we'd prefer they didn't
// do _that_ weird thing" (per rsc). See also #4257.
var reservedimports = []string{
"go",
"type",