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

cmd/go: skip cleaning the current directory if other flags are passed to `go clean` #29925

Open
bcmills opened this Issue Jan 24, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@bcmills
Copy link
Member

bcmills commented Jan 24, 2019

go clean currently removes binaries and certain legacy files from the current directory or specified packages, plus any additional caches as indicated by the -cache, -testcache, and -modcache flags.

However, the user may want to clean the caches from outside of any package directory. The resulting package-loading behavior leads to confusion and delay (#26432, #28680, and perhaps others).

To avoid that confusion, we should make go clean only clean the current directory if either some package is specified as an explicit argument to go clean or the -*cache flags are not set.

(This won't fix #28680 completely, since it will still trigger a fetch if an explicit package argument is given, but it will at least address the common case.)

@bcmills bcmills added this to the Go1.13 milestone Jan 24, 2019

@bcmills bcmills self-assigned this Jan 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment