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 modules should accept version tags without a leading "v" and without a patch version #45266

Closed
kevinburke opened this issue Mar 27, 2021 · 2 comments

Comments

@kevinburke
Copy link
Contributor

kevinburke commented Mar 27, 2021

I tag versions on my projects the same way the Go project does:

  • 0.6
  • 1.0
  • 1.1
  • 1.2
  • 1.3

etc. These versions are not recognized by the Go module tool. I accidentally pushed a tag to my project that someone committed to a fork of my project ("v1.0.2") and despite being live for under an hour, now this tag has been cached by the Go proxy cache in perpetuity, as the "latest" module tag for the project, the default one you get when you try to install the source code.

Since there's no way to delete the tag from the proxy module cache I'm now in the unfortunate position of needing to rewrite all of the tags for my project to include "v" at the beginning, and also include a patch version ("v1.0.0"). This is really unfortunate. This is why I do not use the proxy module cache myself and instruct everyone at my company not to use it either.

It's odd that I should be forced to do this when Go itself does not include patch versions for some of its version numbers - "go1.16" is a valid version - and does not include a leading "v" when tagging or versioning releases.

@kevinburke kevinburke changed the title cmd/go: Go modules should accept version tags without a leading "v" cmd/go: Go modules should accept version tags without a leading "v" and without a patch version Mar 27, 2021
@seankhliao
Copy link
Member

Duplicate of #32945

@seankhliao seankhliao marked this as a duplicate of #32945 Mar 27, 2021
@jayconrod
Copy link
Contributor

@kevinburke If it helps, you can push a new version that retracts the accidentally tagged version and itself. Then @latest should resolve to a pseudo-version again (assuming there are no other release versions).

// Tagged accidentally.
retract v1.0.2

// Only contains retractions.
retract v1.0.3

@golang golang locked and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants