summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-10 00:15:27 -0600
committerJeff Carr <[email protected]>2024-01-10 00:15:27 -0600
commite0fba129e01e138ecf106733012ed4e24f36a904 (patch)
treef26d76046fbe49a15ba01d118205f10b92e32f9e /unix.go
parentbe54390fcd3513d0c1a0a57f783e57f5fe8f9816 (diff)
handle 'any'
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'unix.go')
-rw-r--r--unix.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/unix.go b/unix.go
index 3f7ad0b..e34aef6 100644
--- a/unix.go
+++ b/unix.go
@@ -89,3 +89,16 @@ func normalizeVersion(s string) string {
log.Log(WARN, "normalizeVersion() s =", clean)
return clean
}
+
+func splitVersion(version string) (a, b, c string) {
+ tmp := normalizeVersion(version)
+ parts := strings.Split(tmp, ".")
+ switch len(parts) {
+ case 1:
+ return parts[0], "", ""
+ case 2:
+ return parts[0], parts[1], ""
+ default:
+ return parts[0], parts[1], parts[2]
+ }
+}