Skip to content
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

bcmills opened this issue Jan 24, 2019 · 1 comment


Copy link

@bcmills 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Mar 14, 2019

Change mentions this issue: cmd/go: skip package loading if explicitly cleaning a cache

@gopherbot gopherbot closed this in 9238a8f Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.