mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 04:15:54 +02:00
lint: enable (some) gocritic checks (#3238)
* lint: gocritic configuration * lint: octal literals * lint: gocritic (filepath.Join) * ling: gocritic (badRegexp, regexpSimplify) * lint: gocritic (preferStringWriter) * lint: gocritic (emtpyStringTest) * filepath.Clean(a+b) -> filepath.Join(a, b) * gofumpt
This commit is contained in:
parent
5f22c78fcf
commit
b93b240bd4
45 changed files with 143 additions and 131 deletions
|
@ -213,7 +213,7 @@ func FileInit(fileFolder string, filename string, fileType string) error {
|
|||
if strings.HasPrefix(scanner.Text(), "#") { // allow comments
|
||||
continue
|
||||
}
|
||||
if len(scanner.Text()) == 0 { //skip empty lines
|
||||
if scanner.Text() == "" { //skip empty lines
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,6 @@ func Distinct(params ...any) (any, error) {
|
|||
}
|
||||
}
|
||||
return ret, nil
|
||||
|
||||
}
|
||||
|
||||
func FlattenDistinct(params ...any) (any, error) {
|
||||
|
@ -280,6 +279,7 @@ func flatten(args []interface{}, v reflect.Value) []interface{} {
|
|||
|
||||
return args
|
||||
}
|
||||
|
||||
func existsInFileMaps(filename string, ftype string) (bool, error) {
|
||||
ok := false
|
||||
var err error
|
||||
|
@ -765,7 +765,6 @@ func B64Decode(params ...any) (any, error) {
|
|||
}
|
||||
|
||||
func ParseKV(params ...any) (any, error) {
|
||||
|
||||
blob := params[0].(string)
|
||||
target := params[1].(map[string]interface{})
|
||||
prefix := params[2].(string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue