tools/go/loader
Alan Donovan 02f1928320 go/loader: ignore (*build.Package).Goroot flag when handling "unsafe"
For the default build.Context, the Package.Goroot flag indicates when a
package was loaded from the standard library.  Until now, the loader
used it to enable the typechecker's intrinsics for the "unsafe" package.
This seemed like a good check, but it is troublesome for clients that
use a nonstandard build.Context.  For example, if a client defines
nonstandard Context hooks that load all packages, whether standard or
user-defined, from a flat sstable, there is no way for those hooks to
indicate which packages should have this flag set and which not.  As a
result the contents of the "unsafe" package directory are treated as Go
source code when they are merely documentation.

Change-Id: Iea0a7cc9877507d73606391293971a28279c4e4b
Reviewed-on: https://go-review.googlesource.com/19188
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-02-05 00:45:20 +00:00
..
testdata go/loader: improve robustness in face of input errors 2015-02-02 20:01:59 +00:00
cgo.go x/tools/...: fork and tag !1.5 all files that use go/types et al 2016-01-06 20:40:09 +00:00
cgo14.go x/tools/...: fork and tag !1.5 all files that use go/types et al 2016-01-06 20:40:09 +00:00
doc.go go/loader: changes for vendor support 2015-12-22 18:31:24 +00:00
example14_test.go go/loader: don't treat unsafe specially wrt vendoring 2016-01-08 20:29:04 +00:00
example15_test.go go/loader: don't treat unsafe specially wrt vendoring 2016-01-08 20:29:04 +00:00
example_test.go go/loader: don't treat unsafe specially wrt vendoring 2016-01-08 20:29:04 +00:00
go16.go tools: fallout from flipped sense of build.IgnoreVendor flag 2016-01-08 18:54:48 +00:00
go16_test.go tools: fallout from flipped sense of build.IgnoreVendor flag 2016-01-08 18:54:48 +00:00
loader.go go/loader: ignore (*build.Package).Goroot flag when handling "unsafe" 2016-02-05 00:45:20 +00:00
loader14.go go/loader: ignore (*build.Package).Goroot flag when handling "unsafe" 2016-02-05 00:45:20 +00:00
loader14_test.go x/tools/...: fork and tag !1.5 all files that use go/types et al 2016-01-06 20:40:09 +00:00
loader_test.go go/loader: use Skipf in test 2016-01-08 19:32:38 +00:00
stdlib14_test.go x/tools/...: fork and tag !1.5 all files that use go/types et al 2016-01-06 20:40:09 +00:00
stdlib_test.go all: skip slow tests in short mode 2016-01-28 00:14:01 +00:00
util.go go/loader: don't treat unsafe specially wrt vendoring 2016-01-08 20:29:04 +00:00