Compare commits
5 Commits
1ef50f776d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e97859b87 | |||
| 6718928860 | |||
| 0b2b067575 | |||
| 1a31c082d9 | |||
| b160383186 |
4
README.md
Normal file
4
README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# vercmp
|
||||
[](https://pkg.go.dev/go.elara.ws/vercmp)
|
||||
|
||||
This is a simple library that compares two versions using an algorithm loosely based on the `rpmvercmp` algorithm.
|
||||
4
go.mod
4
go.mod
@@ -1,5 +1,3 @@
|
||||
module go.elara.ws/vercmp
|
||||
|
||||
go 1.20
|
||||
|
||||
require golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
|
||||
go 1.21
|
||||
|
||||
2
go.sum
2
go.sum
@@ -1,2 +0,0 @@
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
|
||||
|
||||
24
vercmp.go
24
vercmp.go
@@ -1,29 +1,11 @@
|
||||
/*
|
||||
* LURE - Linux User REpository
|
||||
* Copyright (C) 2023 Arsen Musayelyan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Package vercmp provides comparison between two arbitrary version strings.
|
||||
// It uses a modified implementation of the rpmvercmp algorithm used by the RPM package manager.
|
||||
package vercmp
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
// Compare compares two version strings.
|
||||
|
||||
@@ -1,27 +1,8 @@
|
||||
/*
|
||||
* LURE - Linux User REpository
|
||||
* Copyright (C) 2023 Arsen Musayelyan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package vercmp
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
func TestSepLabel(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user