Skip to content

Commit 6258454

Browse files
authored
[chore] enable modernize linter (#14153)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR enables the [modernize](https://golangci-lint.run/docs/linters/configuration/#modernize) linter. Example of a linter error: ```sh confmap/internal/decoder.go:171:59: reflecttypefor: reflect.TypeOf call can be simplified using TypeFor (modernize) fieldNameSet := reflect.MakeMap(reflect.MapOf(to.Key(), reflect.TypeOf(true))) ``` Signed-off-by: Paulo Dias <[email protected]>
1 parent dfb79c6 commit 6258454

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.golangci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ linters:
3838
- gosec
3939
- govet
4040
- misspell
41+
- modernize
4142
- nolintlint
4243
- perfsprint
4344
- revive
@@ -55,7 +56,7 @@ linters:
5556
presets:
5657
- std-error-handling
5758

58-
# Excluding configuration per-path, per-linter, per-text and per-source
59+
# Excluding configuration per-path, per-linter, per-text and per-source
5960
rules: []
6061

6162
# Log a warning if an exclusion rule is unused.
@@ -76,7 +77,7 @@ linters:
7677
- pkg: "math/rand$"
7778
desc: "Use the newer 'math/rand/v2' instead of math/rand"
7879
- pkg: "sigs.k8s.io/yaml"
79-
desc: "Use 'go.yaml.in/yaml' instead of sigs.k8s.io/yaml"
80+
desc: "Use 'go.yaml.in/yaml' instead of sigs.k8s.io/yaml"
8081
# Add a different guard rule so that we can ignore tests.
8182
ignore-in-test:
8283
# Allow in tests for testing pdata or other receivers/exporters that expect OTLP.

0 commit comments

Comments
 (0)