If I have a package in my GOPATH go/build.Import works for it. If the package is in the vendor/ directory it doesn't and I wasn't sure the best way to make a vendor/ directory work with go/build. Any pointers would be appreciated.
On Friday, August 21, 2015 at 2:45:12 PM UTC-4, rsc wrote:
On Fri, Aug 21, 2015 at 1:40 PM, Matt Farina matt....@gmail.com wrote:
I noticed the go/build package doesn't work with vendor/ imports. The vendor code was kept in in the go cmd codebase which, I don't think, is available for packages.
Is this a bug? Should the go/build package be able to work with vendor/ imports?
go/build does not know about source code layout, directories, and the like. It just reports what is contained in a set of specified files. In particular, it does not resolve imports. It doesn't tell you whether an imported package exists, for example.
Was there a particular API in go/build that you think should change behavior for vendored imports?