-
Notifications
You must be signed in to change notification settings - Fork 777
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
How to get VSCode to use different Go env vars for different directories in the same repo? #1225
Comments
yes, currently the multi-root setup is the way to go for configuring different settings per folder. Automatically inferring the tags without extra user configuration is an interesting idea, and I am afraid correctly implementing it is not trivial if not impossible. First, the extension provides many different features. Assuming the detection can be automatically done, what features do we want the detected GOOS/GOARCH to be applied to?
Second, many go projects aim for multi OS/Arch support, and often have the source code in the same directory (sometimes with build tags, sometimes based on file names). Automated detection is impossible in the case. An alternative option is to have a special setting to let users specify their desired GOOS/GOARCH, but that overlaps a lot with |
Thanks, @hyangah. I thought that might be the case but went ahead and posted the issue anyway to honor a suggestion made in the golang-nuts thread on this topic. The |
Found this one: microsoft/vscode#32693 |
@hyangah This is the Way. |
Linked the upstream issue from #48 to keep track of the feature support. |
This may or may not be something vscode-go should address.
I ran into a problem with a repository that builds a WebAssembly front end and a server for the backend. The issue was how to pass the required GOOS and GOARCH values when linting the wasm code. I found a solution using VSCode Multi-Root Workspaces, but it required changing my project folder structure and learning the intricacies of .code-workspace and friends.
Please see my original question and detailed answer here on StackOverflow and a related thread on golang-nuts
It would be nice if vscode-go could infer required env vars from source file build tags. Is that possible?
The text was updated successfully, but these errors were encountered: