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

Closed
bcmills opened this issue Jan 24, 2019 · 1 comment
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. FrozenDueToAge GoCommand cmd/go
Milestone

Comments

@bcmills
Copy link
Contributor

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 GoCommand cmd/go early-in-cycle A change that should be done early in the 3 month dev cycle. labels Jan 24, 2019
@bcmills bcmills added this to the Go1.13 milestone Jan 24, 2019
@bcmills bcmills self-assigned this Jan 24, 2019
@gopherbot
Copy link

Change https://golang.org/cl/167717 mentions this issue: cmd/go: skip package loading if explicitly cleaning a cache

@golang golang locked and limited conversation to collaborators Mar 14, 2020
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. FrozenDueToAge GoCommand cmd/go
Projects
None yet
Development

No branches or pull requests

2 participants