https://github.com/Masterminds/semver

caret comparison constraints go golang semantic-versions semver tilde

Last synced: about 1 month ago

Repository metadata:

Work with Semantic Versions in Go


Owner metadata:


Committers metadata

Last synced: about 1 month ago

Total Commits: 163
Total Committers: 29
Avg Commits per committer: 5.621
Development Distribution Score (DDS): 0.27

Commits in past year: 11
Committers in past year: 3
Avg Commits per committer in past year: 3.667
Development Distribution Score (DDS) in past year: 0.273

Name Email Commits
Matt Farina m****t@m****m 119
Mark Rosemaker 4****r 6
mh-cbon m****n 5
Sam Boyer t****h@s****g 5
Grey Baker g****l@g****m 2
Michael Grosser m****l@g****t 2
arshchimni a****i@m****m 2
Alastair Firth a****h 1
Brian-Williams B****s 1
zak z****l 1
Adam Reese a****m@r****o 1
Aniruddha Maru a****u@g****m 1
Dave Goddard d****e@g****u 1
Jeremy Carroll j****c@s****m 1
Johnny Chen j****4@h****m 1
Kirill Zhuravlev k****v@f****m 1
Knut Zuidema me@k****e 1
Kyle Michel K****l@o****m 1
Matt Butcher m****r@e****m 1
Matt Butcher t****s@g****m 1
Nuruddin Ashr u****r@g****m 1
Riley Avron r****n@g****m 1
Robin Schneider r****r@s****e 1
Roli Schilter r****i@s****e 1
Saddam H t****m@g****m 1
Simon Bein s****g@g****m 1
Simon Delicata s****a@f****r 1
mtt0 r****n@f****m 1
ryancurrah r****n@c****a 1

Issue and Pull Request metadata

Last synced: about 1 month ago


Package metadata

go: github.com/Masterminds/semver/v3

Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. Specifically it provides the ability to: There are two functions that can parse semantic versions. The `StrictNewVersion` function only parses valid version 2 semantic versions as outlined in the specification. The `NewVersion` function attempts to coerce a version into a semantic version and parse it. For example, if there is a leading v or a version listed without all 3 parts (e.g. 1.2) it will attempt to coerce it into a valid semantic version (e.g., 1.2.0). In both cases a `Version` object is returned that can be sorted, compared, and used in constraints. When parsing a version an optional error can be returned if there is an issue parsing the version. For example, The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. A set of versions can be sorted using the `sort` package from the standard library. For example, There are two methods for comparing versions. One uses comparison methods on `Version` instances and the other is using Constraints. There are some important differences to notes between these two methods of comparison. There are differences between the two methods or checking versions because the comparison methods on `Version` follow the specification while comparison ranges are not part of the specification. Different packages and tools have taken it upon themselves to come up with range rules. This has resulted in differences. For example, npm/js and Cargo/Rust follow similar patterns which PHP has a different pattern for ^. The comparison features in this package follow the npm/js and Cargo/Rust lead because applications using it have followed similar patters with their versions. Checking a version against version constraints is one of the most featureful parts of the package. There are two elements to the comparisons. First, a comparison string is a list of comma or space separated AND comparisons. These are then separated by || (OR) comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. This can also be written as `">= 1.2, < 3.0.0 || >= 4.2.3"` The basic comparisons are: There are multiple methods to handle ranges and the first is hyphens ranges. These look like: The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the tilde operation. For example, Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes once a stable (1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts as the API stability level. This is useful when comparisons of API versions as a major change is API breaking. For example, In addition to testing a version against a constraint, a version can be validated against a constraint. When validation fails a slice of errors containing why a version didn't meet the constraint is returned. For example,

  • Homepage: https://github.com/Masterminds/semver
  • Documentation: https://pkg.go.dev/github.com/Masterminds/semver/v3#section-documentation
  • Licenses: MIT
  • Latest release: v3.2.1 (published over 1 year ago)
  • Last Synced: 2024-11-11T01:14:45.949Z (about 1 month ago)
  • Versions: 9
  • Dependent Packages: 6,503
  • Dependent Repositories: 27,798
  • Docker Downloads: 31,861,803,849
  • Rankings:
    • Docker downloads count: 0.012%
    • Dependent repos count: 0.036%
    • Dependent packages count: 0.038%
    • Average: 0.921%
    • Stargazers count: 2.043%
    • Forks count: 2.476%
go: github.com/Masterminds/semver

Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. Specifically it provides the ability to: To parse a semantic version use the `NewVersion` function. For example, If there is an error the version wasn't parseable. The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. A set of versions can be sorted using the `sort` package from the standard library. For example, Checking a version against version constraints is one of the most featureful parts of the package. There are two elements to the comparisons. First, a comparison string is a list of comma separated and comparisons. These are then separated by || separated or comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. The basic comparisons are: There are multiple methods to handle ranges and the first is hyphens ranges. These look like: The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the pack level comparison (see tilde below). For example, Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes. This is useful when comparisons of API versions as a major change is API breaking. For example,

  • Homepage: https://github.com/Masterminds/semver
  • Documentation: https://pkg.go.dev/github.com/Masterminds/semver#section-documentation
  • Licenses: MIT
  • Latest release: v1.5.0 (published over 5 years ago)
  • Last Synced: 2024-11-11T01:14:35.953Z (about 1 month ago)
  • Versions: 11
  • Dependent Packages: 6,701
  • Dependent Repositories: 22,957
  • Docker Downloads: 13,723,305,380
  • Rankings:
    • Docker downloads count: 0.022%
    • Dependent packages count: 0.029%
    • Dependent repos count: 0.042%
    • Average: 0.922%
    • Stargazers count: 2.043%
    • Forks count: 2.476%
go: github.com/masterminds/semver

Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. Specifically it provides the ability to: To parse a semantic version use the `NewVersion` function. For example, If there is an error the version wasn't parseable. The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. A set of versions can be sorted using the `sort` package from the standard library. For example, Checking a version against version constraints is one of the most featureful parts of the package. There are two elements to the comparisons. First, a comparison string is a list of comma separated and comparisons. These are then separated by || separated or comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. The basic comparisons are: There are multiple methods to handle ranges and the first is hyphens ranges. These look like: The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the pack level comparison (see tilde below). For example, Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes. This is useful when comparisons of API versions as a major change is API breaking. For example,

  • Homepage: https://github.com/masterminds/semver
  • Documentation: https://pkg.go.dev/github.com/masterminds/semver#section-documentation
  • Licenses: MIT
  • Latest release: v1.5.0 (published over 5 years ago)
  • Last Synced: 2024-11-11T01:14:42.291Z (about 1 month ago)
  • Versions: 11
  • Dependent Packages: 93
  • Dependent Repositories: 31
  • Docker Downloads: 3,230,531,178
  • Rankings:
    • Dependent packages count: 0.437%
    • Docker downloads count: 0.752%
    • Dependent repos count: 1.001%
    • Average: 1.342%
    • Stargazers count: 2.043%
    • Forks count: 2.476%
go: github.com/MasterMinds/semver

Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. Specifically it provides the ability to: To parse a semantic version use the `NewVersion` function. For example, If there is an error the version wasn't parseable. The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. A set of versions can be sorted using the `sort` package from the standard library. For example, Checking a version against version constraints is one of the most featureful parts of the package. There are two elements to the comparisons. First, a comparison string is a list of comma separated and comparisons. These are then separated by || separated or comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. The basic comparisons are: There are multiple methods to handle ranges and the first is hyphens ranges. These look like: The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the pack level comparison (see tilde below). For example, Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes. This is useful when comparisons of API versions as a major change is API breaking. For example,

  • Homepage: https://github.com/MasterMinds/semver
  • Documentation: https://pkg.go.dev/github.com/MasterMinds/semver#section-documentation
  • Licenses: MIT
  • Latest release: v1.5.0 (published over 5 years ago)
  • Last Synced: 2024-11-11T01:15:06.345Z (about 1 month ago)
  • Versions: 11
  • Dependent Packages: 10
  • Dependent Repositories: 5
  • Rankings:
    • Dependent packages count: 1.658%
    • Stargazers count: 2.093%
    • Average: 2.134%
    • Dependent repos count: 2.251%
    • Forks count: 2.534%
go: github.com/masterminds/semver/v3

Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. Specifically it provides the ability to: There are two functions that can parse semantic versions. The `StrictNewVersion` function only parses valid version 2 semantic versions as outlined in the specification. The `NewVersion` function attempts to coerce a version into a semantic version and parse it. For example, if there is a leading v or a version listed without all 3 parts (e.g. 1.2) it will attempt to coerce it into a valid semantic version (e.g., 1.2.0). In both cases a `Version` object is returned that can be sorted, compared, and used in constraints. When parsing a version an optional error can be returned if there is an issue parsing the version. For example, The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. A set of versions can be sorted using the `sort` package from the standard library. For example, There are two methods for comparing versions. One uses comparison methods on `Version` instances and the other is using Constraints. There are some important differences to notes between these two methods of comparison. There are differences between the two methods or checking versions because the comparison methods on `Version` follow the specification while comparison ranges are not part of the specification. Different packages and tools have taken it upon themselves to come up with range rules. This has resulted in differences. For example, npm/js and Cargo/Rust follow similar patterns which PHP has a different pattern for ^. The comparison features in this package follow the npm/js and Cargo/Rust lead because applications using it have followed similar patters with their versions. Checking a version against version constraints is one of the most featureful parts of the package. There are two elements to the comparisons. First, a comparison string is a list of comma or space separated AND comparisons. These are then separated by || (OR) comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. This can also be written as `">= 1.2, < 3.0.0 || >= 4.2.3"` The basic comparisons are: There are multiple methods to handle ranges and the first is hyphens ranges. These look like: The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the tilde operation. For example, Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes once a stable (1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts as the API stability level. This is useful when comparisons of API versions as a major change is API breaking. For example, In addition to testing a version against a constraint, a version can be validated against a constraint. When validation fails a slice of errors containing why a version didn't meet the constraint is returned. For example,

  • Homepage: https://github.com/Masterminds/semver
  • Documentation: https://pkg.go.dev/github.com/masterminds/semver/v3#section-documentation
  • Licenses: MIT
  • Latest release: v3.2.1 (published over 1 year ago)
  • Last Synced: 2024-11-11T01:14:57.526Z (about 1 month ago)
  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Docker Downloads: 117,487,377
  • Rankings:
    • Stargazers count: 1.304%
    • Forks count: 1.593%
    • Average: 4.81%
    • Dependent packages count: 6.999%
    • Dependent repos count: 9.346%
go: github.com/Masterminds/Semver

Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. Specifically it provides the ability to: To parse a semantic version use the `NewVersion` function. For example, If there is an error the version wasn't parseable. The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. A set of versions can be sorted using the `sort` package from the standard library. For example, Checking a version against version constraints is one of the most featureful parts of the package. There are two elements to the comparisons. First, a comparison string is a list of comma separated and comparisons. These are then separated by || separated or comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. The basic comparisons are: There are multiple methods to handle ranges and the first is hyphens ranges. These look like: The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the pack level comparison (see tilde below). For example, Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes. This is useful when comparisons of API versions as a major change is API breaking. For example,

  • Homepage: https://github.com/Masterminds/Semver
  • Documentation: https://pkg.go.dev/github.com/Masterminds/Semver#section-documentation
  • Licenses: MIT
  • Latest release: v1.5.0 (published over 5 years ago)
  • Last Synced: 2024-11-11T01:14:53.577Z (about 1 month ago)
  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 1.304%
    • Forks count: 1.593%
    • Average: 4.81%
    • Dependent packages count: 6.999%
    • Dependent repos count: 9.346%
go: github.com/MasterMinds/semver/v3


Dependencies

.github/workflows/golangci-lint.yml actions
  • actions/checkout v3 composite
  • actions/setup-go v3 composite
  • golangci/golangci-lint-action v3.2.0 composite
.github/workflows/test.yaml actions
  • actions/checkout v3 composite
  • actions/setup-go v3 composite
.github/workflows/codeql.yaml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/fuzz.yaml actions
  • actions/checkout v3 composite
  • actions/setup-go v3 composite
go.mod go