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

Comments

Projects
None yet
3 participants
@mark-rushakoff
Copy link
Contributor

commented Sep 3, 2018

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

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2018

@gopherbot, please add label modules.

@gopherbot gopherbot added the modules label Sep 3, 2018

xiaoxubeii added a commit to xiaoxubeii/go that referenced this issue Sep 3, 2018

clean: clean mod cache should respect "-n" option.
Clean mod cache should print remove commands and not run them when with set "-n" option.
Fixes golang#27458.
@gopherbot

This comment has been minimized.

Copy link

commented Sep 3, 2018

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

@gopherbot

This comment has been minimized.

Copy link

commented Sep 17, 2018

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

@gopherbot gopherbot closed this in f40dc5c Sep 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.