-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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 -cache silently ignores GOCACHE relative path #69997
Comments
I see a couple of issues here:
I'd like to work on this. I see a couple of ways to address the second point.
|
I don't think we need to document the absolute path requirement in the "Build and test caching" section, but that we should in the I agree that there's no nice way to address the second point, though my preference is to return string, bool, error. (We already had to change the usages to ignore the |
Currently, if computing of the go cache directory fails it does not expose the error. Commands like go clean, exec, modindex that use go cache directory continue execution producing incorrect or no result. This patch adds an error to the return values such that it can be validated on call sites. It also introduces such validation in go clean -cache command to fail execution in case when error occurred. Fixes golang#69997
Change https://go.dev/cl/628596 mentions this issue: |
Go version
go version go1.23.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
GOCACHE='.cache' go clean --cache
What did you see happen?
No output. Neither default gocache directory nor ".cache" directory cleaned up.
What did you expect to see?
Error or empty
.cache
directory.The text was updated successfully, but these errors were encountered: