Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Delete tooling source code once it's installed #532

Closed
ahmetb opened this issue Oct 14, 2016 · 5 comments
Closed

Delete tooling source code once it's installed #532

ahmetb opened this issue Oct 14, 2016 · 5 comments

Comments

@ahmetb
Copy link

ahmetb commented Oct 14, 2016

For tools like go-outline go-symbols gocode godef golint gopkgs gorename goreturns guru vscode-go plugin installs, can we delete their source code from $GOPATH/src once they are installed to $GOPATH/bin?

There's not much point of keeping these around I suppose?

@ramya-rao-a
Copy link
Contributor

That's a good idea, there is no need to bloat up the user's workspace.
Need to ensure that if the source code already exists before tool installation, we don't delete it.

@vanackere
Copy link
Contributor

vanackere commented Oct 17, 2016

I don't thing vscode-go should interact with user GOPATH at all. Installing packages there automatically is not a nice behaviour, but automatically deleting directories there would be even worse (what if the user has installed those packages for other uses ?).
IMHO the right fix would be to use a temporary GOPATH (under /tmp or %TEMPDIR%) to build the binaries and copy them somewhere under the .vscode directory. The temporary GOPATH could then be safely deleted.

@ahmetb
Copy link
Author

ahmetb commented Oct 17, 2016

I think the ideal solution is to install these tools permanently at some path that can be shared across projects, outside $GOPATH.

@ramya-rao-a
Copy link
Contributor

With #351 merged in, there will now be an option to install the Go tools that the Go extension needs in a separate location.
Deleting the source code for these tools in this situation is doable

@ramya-rao-a
Copy link
Contributor

The latest update (0.6.53) gives the user an option to install the go tools to an alternate location.

This is done via the new setting go.toolsGopath where you can provide the alternate location.

Remember to run Go: Install Tools after setting the above setting, so that the tools get installed to this location. After which, you can safely delete the ones from your GOPATH.

Note: dlv and gometalinter tools are exceptions to this rule. Reason being that gometalinter internally installs linters and expects them to be in the user's GOPATH. And that the debugger is not aware of any VS Code settings and so will not be able to find dlv from any location other than PATH or user's GOPATH

Please give it a try and comment here (or open a new issue) if you see any issues.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants