mark-kubacki / semver Goto Github PK
View Code? Open in Web Editor NEW:100: parse semantic version numbers, and ranges (the most often imitated original)
License: BSD 3-Clause "New" or "Revised" License
:100: parse semantic version numbers, and ranges (the most often imitated original)
License: BSD 3-Clause "New" or "Revised" License
The radix sort variants need a byte-swapping to work on Big-endian architectures such as mips mips64 ppc64 s390x
. (This is indicated by runtime/internal/sys.BigEndian
, but don't use that value; use GOARCH build flags.)
Without one the sorting will work, and iterate as usual through fields, but within fields go from the most to least significant digit (byte). Adjustment values for negative fields will be off, though, as those are encoded in uint64
.
For my notes: https://github.com/tensorflow/tensorflow/blob/0fec909abb8057fcb6141769df17bcad729ca870/tensorflow/go/tensor.go#L493-L510
Thanks for this lib, Mark. I'm wondering if you'd entertain a discussion (even a brief one) about the possibility of a function that takes as input a semantic version and returns a list of (reasonable) possible next versions.
In other words, given this:
"v1.0.0"
The function might return:
[]string{"v1.0.1", "v1.1.0", "v2.0.0"}
And (optionally?) some pre-release "next" versions as well. I'm using this to prompt a user what to tag a commit as.
Would this function have a place in your lib?
Trying to understand when I would want to use this over theirs. https://github.com/hashicorp/go-version Not trying to start any religious war.
It would be great if you could access a "version field" such as
v := semver.NewVersion("1.0.0")
fmt.Println(v.Major)
fmt.Println(v.Minor)
fmt.Println(v.Patch)
I am wondering if you'd welcome a pull request to have NewVersion() return a *Version
instead of a Version
, mostly because all the methods are implemented with pointer receivers, so I can't easily make a NewVersion() and then call methods on them; I have to reference them every time, or re-assign the variable.
Currently:
current, err := semver.NewVersion("1.2.3")
fmt.Printf("%s\n", current) // formatting error
fmt.Printf("%s\n" ¤t) // works
Not a big deal, but could make my use of the returned value a little simpler in actual code, where I have to constantly reference it or re-assign the variable. It's also possible that I'm misusing the lib, just let me know if that's the case!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.