Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/build: support vendor experiment? #12414

rsc opened this issue Aug 31, 2015 · 2 comments

go/build: support vendor experiment? #12414

rsc opened this issue Aug 31, 2015 · 2 comments


Copy link

rsc commented Aug 31, 2015

---------- Forwarded message ----------
From: Matt Farina
Date: Fri, Aug 21, 2015 at 3:08 PM
Subject: Re: [golang-dev] go/build and vendor imports
To: golang-dev

The Import method on Context (available as go/build.Import() under a default confit) knows about the goroot and gopath when trying to resolve packages. See

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 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?


You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

@rsc rsc self-assigned this Aug 31, 2015
@rsc rsc added this to the Go1.6Early milestone Aug 31, 2015
Copy link

pwaller commented Oct 19, 2015

This appears to be a duplicate of #12278

Copy link

minux commented Oct 19, 2015

Closing as dup.

@minux minux closed this as completed Oct 19, 2015
@golang golang locked and limited conversation to collaborators Oct 24, 2016
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

4 participants