Adding full pre-release version comparison support. #4

Merged
merged 1 commit into from Mar 4, 2014

Conversation

Projects
None yet
2 participants
Contributor

amerine commented Mar 4, 2014

Hey there CoreOS folks,

I was toying with this library and I had the need to do a little more accurate
pre-release comparisons. I saw the TODO and decided to bite if off. I started by
adding the values at the bottom of secion 11 here: http://semver.org to the
tests and change
https://github.com/amerine/go-semver/blob/29b30448e895b3a00419003f027196bf17ca2a58/semver/semver.go#L99
to actually check versionB.

This resulted in some failures that I could work against. The solution here
needs to check for ints and strings based on the precedence rules that semver
prefers. I was hoping for a cleaner way of doing that, but nothing I threw at
the problem was quicker than what I'm using here (manual type conversions and
leaning on the success/failure of that to decide where to proceed.)

❤️ Amerine

Adding full pre-release version comparison support.
I was toying with this library and I had the need to do a little more accurate
pre-release comparisons. I saw the TODO and decided to bite if off. I started by
adding the values at the bottom of secion 11 here: http://semver.org to the
tests and change
https://github.com/amerine/go-semver/blob/29b30448e895b3a00419003f027196bf17ca2a58/semver/semver.go#L99
to actually check versionB.

This resulted in some failures that I could work against. The solution here
needs to check for ints and strings based on the precedence rules that semver
prefers. I was hoping for a cleaner way of doing that, but nothing I threw at
the problem was quicker than what I'm using here (manual type conversions and
leaning on the success/failure of that to decide where to proceed.)
Owner

philips commented Mar 4, 2014

this lgtm; thanks for taking it on.

philips added a commit that referenced this pull request Mar 4, 2014

Merge pull request #4 from amerine/full-prerelease-support
Adding full pre-release version comparison support.

@philips philips merged commit 36d3ff4 into coreos:master Mar 4, 2014

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment