mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
lint (errorlint) (#2644)
This commit is contained in:
parent
c2c173ac7e
commit
08694adf1b
8 changed files with 27 additions and 33 deletions
3
pkg/cache/cache.go
vendored
3
pkg/cache/cache.go
vendored
|
@ -1,6 +1,7 @@
|
|||
package cache
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/bluele/gcache"
|
||||
|
@ -104,7 +105,7 @@ func GetKey(cacheName string, key string) (string, error) {
|
|||
if name == cacheName {
|
||||
if value, err := Caches[i].Get(key); err != nil {
|
||||
//do not warn or log if key not found
|
||||
if err == gcache.KeyNotFoundError {
|
||||
if errors.Is(err, gcache.KeyNotFoundError) {
|
||||
return "", nil
|
||||
}
|
||||
CacheConfig[i].Logger.Warningf("While getting key %s in cache %s: %s", key, cacheName, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue