-
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
doesn't remove binaries installed by go install module@version
#65687
Comments
It's just a binary file. Why insist in invoking a special command when you can just rm it? |
@gophun For the same reason The fact that it doesn't work seemed like a bug to me. In a practical sense:
|
The docs for
And the docs for
So it would seem that Also, I don't think something like I can see the argument for |
I think this might be a documentation issue. The words |
I guess it would not hurt if |
That could be helpful, yea.
Especially since setting GOPATH is no longer required with module mode. |
One easy but slightly hacky way to do this: install it, then immediately run install -n:
|
The installed version should be recorded in a metadata block in the binary (compare That said, I do think it would be reasonable for |
See: |
Go version
go version go1.21.7 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I installed a binary via
go install
and then was unable to use the same tool to uninstall/clean the installed package binary.I had to manually remove the binary via
rm
.What did you see happen?
What did you expect to see?
I expected that a
go clean github.com/Rican7/define
would remove the package binary that it had installed.It would likely make sense to have the command maybe be
go clean -i github.com/Rican7/define@latest
, but maybe the version suffix is awkward?The version suffix is what changes the behavior of
go install
to no longer consider the current module (go.mod
) defined version, so there would be symmetry there, but also having to specify the version to uninstall might be awkward.I couldn't find anything related to this, beyond maybe #50261.
Also, a quick search shows that there seems to be a lot of confusion around this very (lack of?) behavior:
The text was updated successfully, but these errors were encountered: