-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow to set build tags #6
Conversation
In my opinion, changing the signature isn't really an option, especially because the new API doesn't look sane, having to carry The real issue is that the user cannot modify the build context. One option would be to allow access to the global build context, but that wouldn't be thread-safe. Another option might be to provide a new type ( It should be noted that this code is lifted directly from the Go tool. |
That would mean that most functions will be turned into methods of the new Context type. Also the old ImportPaths would then instantiate a Context. Is that OK? |
That sounds fine to me, but let's wait for @kisielk |
Okay, I had some time to look in to how the go tool works with regards to the build context. I agree we should just provide our own |
Sounds good. So it is also fine with you to convert the currently touched functions into methods? —Reply to this email directly or view it on GitHub. |
Yeah, the unexported functions can be made in to the methods on the new type. The exported |
dc0c1f9
to
0bab4e8
Compare
Done, please take another look. |
Looks good. Next step is to use |
I now that this breaks the API but the usage is wrong without it if you support build tags in a tool, like in errcheck. I will send out a PR for this in a moment.