-
Notifications
You must be signed in to change notification settings - Fork 645
Support variable substitution for go.path setting #343
Comments
This is something that VS Code would need to support - I believe microsoft/vscode#2809 is tracking this, and microsoft/vscode#3759 was another similar report related to
FWIW - Addressing that particular issue without forcing you to use a dual GOPATH is what #5 has been tracking. |
Yes, I agree, it would be better if it was supported by vscode natively. However, this extension is already doing it for $workspaceRoot (here) so why not for environment variables? I saw all the issues you are refering to, but all of them have been closed or postponed. About #5, I don't think managing the go tools in a specific way to the IDE is a good idea. What if I want to use another editor/IDE? Should the go tools be duplicated for each IDE I use? I think it's best to work as suggested by golang and with the solutions provided by golang. Multiple GOPATH is such a solution: one path for all the shared tools and dependencies, another one for the current project, then the vendor directory for the specific dependencies. |
I already implemented this in my own repo. I can create a pull request if you are interested. |
This feature is now available in the latest update to the Go extension (0.7.0) |
It would be nice if environment variable substitution was possible with the
go.path
setting. I use a separate workspace for each of my go projects and I append the current project path to theGOPATH
variable. That way I keep the shared tools (gofmt, golint...) together and I don't have to download them for each project.With the
go.path
setting I can configure vscode to work this way, however I have to "hard code" my path:"go.gopath": "C:/devel/go;${workspaceRoot}"
where
C:/devel/go
is myGOPATH
.I would like to be able to set it as follow:
"go.gopath": "${env.GOPATH};${workspaceRoot}"
The text was updated successfully, but these errors were encountered: