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: go clean -n -modcache does not respect -n option #27458

Closed
mark-rushakoff opened this issue Sep 3, 2018 · 3 comments
Closed

cmd/go: go clean -n -modcache does not respect -n option #27458

mark-rushakoff opened this issue Sep 3, 2018 · 3 comments
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mark-rushakoff
Copy link
Contributor

What version of Go are you using (go version)?

bash-3.2$ go version
go version go1.11 darwin/amd64

Does this issue reproduce with the latest release?

Didn't try with tip, but cmd/go/internal/clean/clean.go looks like it will behave the same.

What did you do?

bash-3.2$ du -sh ~/go/pkg/mod # Check size of mod cache...
112M	/Users/mr/go/pkg/mod
bash-3.2$ go clean -n -modcache
cd /Users/mr/foo/bar
rm -f bar.test bar.test.exe
bash-3.2$ du -sh ~/go/pkg/mod # Uh oh!
du: /Users/mr/go/pkg/mod: No such file or directory

What did you expect to see?

Output like rm -rf $HOME/go/pkg/mod, and for the files in there to remain undeleted.

What did you see instead?

It appeared to be the output of go clean -n, and the effect of go clean -modcache.

@mark-rushakoff
Copy link
Contributor Author

@gopherbot, please add label modules.

xiaoxubeii added a commit to xiaoxubeii/go that referenced this issue Sep 3, 2018
Clean mod cache should print remove commands and not run them when with set "-n" option.
Fixes golang#27458.
@gopherbot
Copy link

Change https://golang.org/cl/133056 mentions this issue: clean: clean mod cache should respect "-n" option.

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 11, 2018
@bcmills bcmills added this to the Go1.12 milestone Sep 11, 2018
@gopherbot
Copy link

Change https://golang.org/cl/135695 mentions this issue: clean: clean mod cache should respect "-n" option.

@golang golang locked and limited conversation to collaborators Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants