tools/go/loader
Alan Donovan 0f870d4d86 go/loader: fix interaction of cwd and vendor
Packages specified on the command line should be interpreted relative to
cwd iff they are local (e.g. ./http within $GOROOT/src/net), otherwise a
request for, say, "golang.org/x/net/http2/hpack" might return the vendored
package depending on the working directory.

The FindPackage hook function now takes a build.ImportMode parameter, so
it matches the signature of (*build.Context).Import.  The AllowVendor
flag is enabled only for imports within source files, but not for the
initial packages.

+ test.

Change-Id: I756dc46b70928d2fd9f824e6670092d8169e0d64
Reviewed-on: https://go-review.googlesource.com/18318
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-06 18:28:16 +00:00
..
testdata go/loader: improve robustness in face of input errors 2015-02-02 20:01:59 +00:00
cgo.go go/loader: fix fd leak and limit calls to ioutil.ReadDir 2015-08-18 23:39:26 +00:00
doc.go go/loader: changes for vendor support 2015-12-22 18:31:24 +00:00
example14_test.go go/loader: exclude example tests from Windows tests 2015-07-31 22:13:26 +00:00
example15_test.go go/loader: fix tests to work at go1.5 and tip 2015-12-28 22:42:32 +00:00
example_test.go go/loader: fix tests to work at go1.5 and tip 2015-12-28 22:42:32 +00:00
loader.go go/loader: fix interaction of cwd and vendor 2016-01-06 18:28:16 +00:00
loader_test.go go/loader: fix interaction of cwd and vendor 2016-01-06 18:28:16 +00:00
stdlib_test.go go/loader: in stdlib_test, remove workaround for lack of vendoring 2015-12-30 16:37:28 +00:00
util.go go/loader: changes for vendor support 2015-12-22 18:31:24 +00:00