From 4d36e768efc3aafeb5b2cdd887f3f258950432eb Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 17 Jul 2024 09:44:40 +0200 Subject: [PATCH] deps: use go-cs-lib 0.13 --- go.mod | 2 +- go.sum | 4 ++-- pkg/cwversion/version.go | 17 +++-------------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 1bc63a470df..6a2146efc5f 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/corazawaf/libinjection-go v0.1.2 github.com/crowdsecurity/coraza/v3 v3.0.0-20240108124027-a62b8d8e5607 github.com/crowdsecurity/dlog v0.0.0-20170105205344-4fb5f8204f26 - github.com/crowdsecurity/go-cs-lib v0.0.11 + github.com/crowdsecurity/go-cs-lib v0.0.13 github.com/crowdsecurity/grokky v0.2.1 github.com/crowdsecurity/machineid v1.0.2 github.com/davecgh/go-spew v1.1.1 diff --git a/go.sum b/go.sum index ba4e6267bb9..faca9797341 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,8 @@ github.com/crowdsecurity/coraza/v3 v3.0.0-20240108124027-a62b8d8e5607 h1:hyrYw3h github.com/crowdsecurity/coraza/v3 v3.0.0-20240108124027-a62b8d8e5607/go.mod h1:br36fEqurGYZQGit+iDYsIzW0FF6VufMbDzyyLxEuPA= github.com/crowdsecurity/dlog v0.0.0-20170105205344-4fb5f8204f26 h1:r97WNVC30Uen+7WnLs4xDScS/Ex988+id2k6mDf8psU= github.com/crowdsecurity/dlog v0.0.0-20170105205344-4fb5f8204f26/go.mod h1:zpv7r+7KXwgVUZnUNjyP22zc/D7LKjyoY02weH2RBbk= -github.com/crowdsecurity/go-cs-lib v0.0.11 h1:ygUOKrkMLaJ2wjC020LgtY6XDkToNFK4NmYlhpkk5ko= -github.com/crowdsecurity/go-cs-lib v0.0.11/go.mod h1:8FMKNGsh3hMZi2SEv6P15PURhEJnZV431XjzzBSuf0k= +github.com/crowdsecurity/go-cs-lib v0.0.13 h1:asmtjIEPOibUK8eaYQCIR7XIBU/EX5vyAp1EbKFQJtY= +github.com/crowdsecurity/go-cs-lib v0.0.13/go.mod h1:ePyQyJBxp1W/1bq4YpVAilnLSz7HkzmtI7TRhX187EU= github.com/crowdsecurity/grokky v0.2.1 h1:t4VYnDlAd0RjDM2SlILalbwfCrQxtJSMGdQOR0zwkE4= github.com/crowdsecurity/grokky v0.2.1/go.mod h1:33usDIYzGDsgX1kHAThCbseso6JuWNJXOzRQDGXHtWM= github.com/crowdsecurity/machineid v1.0.2 h1:wpkpsUghJF8Khtmn/tg6GxgdhLA1Xflerh5lirI+bdc= diff --git a/pkg/cwversion/version.go b/pkg/cwversion/version.go index 01509833c1c..28d5c2a621c 100644 --- a/pkg/cwversion/version.go +++ b/pkg/cwversion/version.go @@ -10,7 +10,7 @@ import ( ) var ( - Codename string // = "SoumSoum" + Codename string // = "SoumSoum" Libre2 = "WebAssembly" ) @@ -21,19 +21,8 @@ const ( Constraint_acquis = ">= 1.0, < 2.0" ) -func versionWithTag() string { - // if the version number already contains the tag, don't duplicate it - ret := version.Version - - if !strings.HasSuffix(ret, version.Tag) && !strings.HasSuffix(ret, "g"+version.Tag+"-dirty") { - ret += "-" + version.Tag - } - - return ret -} - func FullString() string { - ret := fmt.Sprintf("version: %s\n", versionWithTag()) + ret := fmt.Sprintf("version: %s\n", version.String()) ret += fmt.Sprintf("Codename: %s\n", Codename) ret += fmt.Sprintf("BuildDate: %s\n", version.BuildDate) ret += fmt.Sprintf("GoVersion: %s\n", version.GoVersion) @@ -49,7 +38,7 @@ func FullString() string { } func UserAgent() string { - return "crowdsec/" + versionWithTag() + "-" + version.System + return "crowdsec/" + version.String() + "-" + version.System } // VersionStrip remove the tag from the version string, used to match with a hub branch