dependencies: replaced function calls to pkg/types, errors.Wrap (#2235)

we now use a generic pointer function, and slowly remove the deprecated pkg/errors
This commit is contained in:
mmetc 2023-06-01 16:31:56 +02:00 committed by GitHub
parent 12c32d507c
commit 396dcf8e6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 131 additions and 132 deletions

View file

@ -20,15 +20,15 @@ import (
"github.com/davecgh/go-spew/spew"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
"github.com/umahmood/haversine"
"github.com/wasilibs/go-re2"
"github.com/crowdsecurity/go-cs-lib/pkg/ptr"
"github.com/crowdsecurity/crowdsec/pkg/cache"
"github.com/crowdsecurity/crowdsec/pkg/database"
"github.com/crowdsecurity/crowdsec/pkg/fflag"
"github.com/crowdsecurity/crowdsec/pkg/types"
"github.com/wasilibs/go-re2"
)
var dataFile map[string][]string
@ -91,13 +91,13 @@ func RegexpCacheInit(filename string, CacheCfg types.DataSource) error {
//cache is enabled
if CacheCfg.Size == nil {
CacheCfg.Size = types.IntPtr(50)
CacheCfg.Size = ptr.Of(50)
}
gc := gcache.New(*CacheCfg.Size)
if CacheCfg.Strategy == nil {
CacheCfg.Strategy = types.StrPtr("LRU")
CacheCfg.Strategy = ptr.Of("LRU")
}
switch *CacheCfg.Strategy {
case "LRU":