How can I use module tags that do not follow the semantic versioning conventions?

I use a public go module, let’s call it “abc” that has tags like this:

abc-5.0.0
abc-5.0.1
abc-5.0.2
abc-5.1
abc-5.2
...

This seems similar to semantic versioning, but instead of “v” prefix, it uses “abc-” prefix.

Can I put something in my go.mod file that specifies which of these tags to use, or to use the latest abc-5.* tag?

If I don’t publish my code, I can checkout the imported module locally with the tag that I want to use, and add this in my go.mod file:

replace abc => /{local-path-to-abc}

But if I publish my code, and somebody else wants to use it, they also have to checkout the specific version of the abc module manually (or a newer version, if they prefer), and they have to use the same local path, or they have to modify my go.mod file.

I believe the answer is:
go get {module-import-path}@{tag}, where {tag} is any tag, not just semantic versioning tags.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.