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:
mmetc 2024-09-17 17:07:30 +02:00 committed by GitHub
parent 5f22c78fcf
commit b93b240bd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 143 additions and 131 deletions

View file

@ -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)