This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
Support for semantic version strings and comparison #912
Unanswered
codewithcheese
asked this question in
Q&A
Replies: 2 comments
-
Apologies for the delay in replying, @codewithcheese. A regexp approach will work (per #407 (comment)). And per @mpvl the plan at the moment is not necessarily to provide a builtin equivalent of https://pkg.go.dev/golang.org/x/mod/semver, rather to consider what building blocks would be better primitive (@mpvl gives the example of https://pkg.go.dev/golang.org/x/text/collate |
Beta Was this translation helpful? Give feedback.
0 replies
-
This discussion has been migrated to cue-lang/cue#912. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi CUEbies
Do you know of any implementations for semantic version and comparison in-built or CUE? I see there is an issue from a year ago here: #407
I am about to implement a CUE based solution for semantic version strings and comparison but double checking before coding.
I'm planning a CUE based solution, use regexp to parse a version string into its components something like
{ major: number, minor: number, patch: number, extension:string }
then implement a comparison function; a long list of conditionals which probably wont be pretty but get the job done.We use semantic version strings in our config files to represent versions and also have a need for version comparison to check that component updates are mutually compatible.
Beta Was this translation helpful? Give feedback.
All reactions