]> Cypherpunks repositories - gostls13.git/commit
go/build: fix ImportDir to report PkgTarget for directories in GOROOT/GOPATH
authorRuss Cox <rsc@golang.org>
Wed, 1 Nov 2017 20:12:40 +0000 (16:12 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 2 Nov 2017 03:33:33 +0000 (03:33 +0000)
commit21e6612d6fc29742024132f7f081e558c6807737
tree4b392f1d75dae6547f01790fc620d23680909bbe
parent1114d403fa7d16247a3c569978290d0827f224a1
go/build: fix ImportDir to report PkgTarget for directories in GOROOT/GOPATH

This makes ImportDir("$GOROOT/src/math", 0)
and Import("math", "", 0) equivalent. It was an
oversight that they were not before.

An upcoming change to the go command relies on
the two returning the same results.

Change-Id: I187da4830fae85f8dde673c22836ff2da6801047
Reviewed-on: https://go-review.googlesource.com/75290
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/go/build/build.go
src/go/build/build_test.go