Skip to content

Commit

Permalink
use golang lint rules to ignore some warnings for better reading the …
Browse files Browse the repository at this point in the history
…code

Signed-off-by: Icarus Wu <[email protected]>
  • Loading branch information
Icarus9913 committed Dec 20, 2024
1 parent 6f6e858 commit 10c9bcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ issues:
- linters:
- gocritic
text: "appendAssign: append result not assigned to the same slice" # None of the instances of this in Kuma were bugs.
- linters:
- gocritic
text: "elseif: can replace 'else {if cond {}}' with 'else if cond {}'" # None of the instances of this in Kuma were bugs.
- linters:
- gosimple
text: "S1008: should use 'return overlapKeyCount != 0' instead of 'if overlapKeyCount == 0 { return false }; return true'" # Ignore this to better read the code
- linters:
- staticcheck
text: "SA1019: package sigs.k8s.io/controller-runtime/pkg/client/fake is deprecated" # https://github.com/kumahq/kuma/issues/2460
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/policies/core/rules/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (ss Subset) ContainsElement(element Element) bool {
}
} else {
// for those items that don't exist in element should not make an impact
if tag.Not == false {
if !tag.Not {
return false
}
}
Expand Down

0 comments on commit 10c9bcf

Please sign in to comment.