Skip to content

Commit

Permalink
build(lint): Add gocognit to golangci-lint linter list (#483)
Browse files Browse the repository at this point in the history
gocognit aims to reduce "cognitive complexity" of functions.
  • Loading branch information
thunderboltsid authored Sep 25, 2024
1 parent d967a56 commit 78f61d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ linters:
- nolintlint
- staticcheck
- unused
- gocognit
linters-settings:
nolintlint:
require-explanation: true
Expand Down
5 changes: 3 additions & 2 deletions controllers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,10 @@ func deleteCategoryKeyValues(ctx context.Context, client *prismclientv3.Client,
ciValue := ci.Value
if gck, ok := groupCategoriesByKey[ciKey]; ok {
groupCategoriesByKey[ciKey] = append(gck, ciValue)
} else {
groupCategoriesByKey[ciKey] = []string{ciValue}
continue
}

groupCategoriesByKey[ciKey] = []string{ciValue}
}

for key, values := range groupCategoriesByKey {
Expand Down

0 comments on commit 78f61d1

Please sign in to comment.