kosmoscpp/port-semver-go ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Go library for working with semantic versions, basically a clean port of python semver 3.0.4.

I want it to be able to parse version strings, turn them back into strings, compare versions correctly, bump major minor and patch, check if a version is valid, and support next version helpers. It should follow SemVer 2.0.0 rules, including prerelease and build metadata handling, and comparison should behave the same way python semver does.

Please keep the scope focused, I do not need range matching, CLI commands, or Python style convenience methods. Make it feel idiomatic for Go, with good tests that cover the important cases. If you need to check the exact behavior, look up the original python semver docs or source online and match that behavior as closely as possible.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab