9b0ccf41c2 | ||
---|---|---|
LICENSE | ||
README.md | ||
example_test.go | ||
go.mod | ||
sort.go | ||
unit_test.go |
README.md
src.lwithers.me.uk/go/versionsort
This package provides a Go implementation of the venerable C function
versionsort(3)
. This lets you sort strings containing natural numbers, such
as versions. It understands that 1.12
is greater than 1.6
, for example.
Example of usage:
input := []string{"1.12", "1.24", "1.1", "1.6"}
versionsort.Strings(input)
fmt.Println(input)
// Output: [1.1 1.6 1.12 1.24]