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

Add new constructor that strictly adheres to semver specs #45

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

findkim
Copy link
Contributor

@findkim findkim commented Dec 14, 2018

The changes below adds a new optional constructor that strictly adheres to semver pre-release specs

  1. Requires versions with pre-releases to have the - separator
  2. Non-empty pre-release identifier

Without the hyphen - separator between the version and pre-release, it adds complexity to parse for X.Y.Z as non-negative integers -- where the Z component encompasses the pre-release and becomes alphanumeric

Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think this is a good way to do it.

I think some internal details might have to change (i.e. moving from just switching the regexp to actually a boolean-like flag that signifies we're in "semver mode"), but those are unexported details so we can easily change that up later.

@mitchellh mitchellh merged commit d40cf49 into hashicorp:master Jan 7, 2019
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Oct 24, 2019
full diff: hashicorp/go-version@23480c0...v1.2.0

includes:

- hashicorp/go-version#53 Implement GreaterThanOrEqual + LessThanOrEqual
- hashicorp/go-version#45 Add new constructor that strictly adheres to semver specs
- hashicorp/go-version#40 Support Original to return original version
    - fixes hashicorp/go-version#16 Store and allow retrieval of the string of the version in its original form
    - fixes hashicorp/go-version#27 Support for zero padded numbers (e.g. `17.03.0-ce`)
- hashicorp/go-version#41 Segments64 makes a copy to match Segments
- hashicorp/go-version#38 When using a specific pattern, unintended results are returned

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Oct 29, 2019
full diff: hashicorp/go-version@23480c0...v1.2.0

includes:

- hashicorp/go-version#53 Implement GreaterThanOrEqual + LessThanOrEqual
- hashicorp/go-version#45 Add new constructor that strictly adheres to semver specs
- hashicorp/go-version#40 Support Original to return original version
    - fixes hashicorp/go-version#16 Store and allow retrieval of the string of the version in its original form
    - fixes hashicorp/go-version#27 Support for zero padded numbers (e.g. `17.03.0-ce`)
- hashicorp/go-version#41 Segments64 makes a copy to match Segments
- hashicorp/go-version#38 When using a specific pattern, unintended results are returned

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 87cf5b606a07607b03b311085d5b66a0944ec53c
Component: cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants