1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-29 23:07:45 +02:00

chore: enable gocritic linter (#7095)

#### Description

Enable and fixes several rules from
[gocritic](https://golangci-lint.run/usage/linters/#gocritic) linter

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Matthieu MOREL
2025-07-29 18:20:32 +02:00
committed by GitHub
parent 8955578fef
commit 982391315f
37 changed files with 158 additions and 146 deletions

View File

@@ -15,7 +15,7 @@ type Filter func(KeyValue) bool
//
// If keys is empty a deny-all filter is returned.
func NewAllowKeysFilter(keys ...Key) Filter {
if len(keys) <= 0 {
if len(keys) == 0 {
return func(kv KeyValue) bool { return false }
}
@@ -34,7 +34,7 @@ func NewAllowKeysFilter(keys ...Key) Filter {
//
// If keys is empty an allow-all filter is returned.
func NewDenyKeysFilter(keys ...Key) Filter {
if len(keys) <= 0 {
if len(keys) == 0 {
return func(kv KeyValue) bool { return true }
}