From: Robert Griesemer Date: Fri, 12 Jan 2018 01:37:16 +0000 (-0800) Subject: cmd/compile: document reserved import paths X-Git-Tag: go1.10rc1~45 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8554fd6e7dbfc76805ca48b71765879eeb6fb64d;p=gostls13.git cmd/compile: document reserved import paths Fixes #20708. Change-Id: I2db450947b64b8b5af3822c7fbcc3e99746ae9d7 Reviewed-on: https://go-review.googlesource.com/87496 Reviewed-by: Brad Fitzpatrick Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index a45c15a44e..e0925dc7f2 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -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",