Skip to content

Commit 10249ca

Browse files
committed
Apply review findings
1 parent 2a3a39c commit 10249ca

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

.golangci.example.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,6 @@ linters-settings:
103103
# should ignore tests (default false)
104104
skip-tests: false
105105

106-
errchkjson:
107-
# with check-error-free-encoding set to true, errchkjson does warn about errors
108-
# from json encoding functions that are safe to be ignored,
109-
# because they are not possible to happen (default false)
110-
#
111-
# if check-error-free-encoding is set to true and errcheck linter is enabled,
112-
# it is recommended to add the following exceptions to prevent from false positives:
113-
#
114-
# linters-settings:
115-
# errcheck:
116-
# exclude-functions:
117-
# - encoding/json.Marshal
118-
# - encoding/json.MarshalIndent
119-
# - (*encoding/json.Encoder).Encode
120-
check-error-free-encoding: false
121-
# if report-no-exported is true, encoding a struct without exported fields is reported as issue (default false)
122-
report-no-exported: false
123-
124106
dogsled:
125107
# checks assignments with too many blank identifiers; default is 2
126108
max-blank-identifiers: 2
@@ -155,6 +137,24 @@ linters-settings:
155137
- io.Copy(*bytes.Buffer)
156138
- io.Copy(os.Stdout)
157139

140+
errchkjson:
141+
# with check-error-free-encoding set to true, errchkjson does warn about errors
142+
# from json encoding functions that are safe to be ignored,
143+
# because they are not possible to happen (default false)
144+
#
145+
# if check-error-free-encoding is set to true and errcheck linter is enabled,
146+
# it is recommended to add the following exceptions to prevent from false positives:
147+
#
148+
# linters-settings:
149+
# errcheck:
150+
# exclude-functions:
151+
# - encoding/json.Marshal
152+
# - encoding/json.MarshalIndent
153+
# - (*encoding/json.Encoder).Encode
154+
check-error-free-encoding: false
155+
# if report-no-exported is true, encoding a struct without exported fields is reported as issue (default false)
156+
report-no-exported: false
157+
158158
errorlint:
159159
# Check whether fmt.Errorf uses the %w verb for formatting errors. See the readme for caveats
160160
errorf: true

pkg/lint/lintersdb/manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
552552
WithURL("https://github.com/breml/bidichk"),
553553
linter.NewConfig(golinters.NewErrChkJSONFuncName(errchkjsonCfg)).
554554
WithSince("1.44.0").
555-
WithPresets(linter.PresetBugs, linter.PresetUnused).
555+
WithPresets(linter.PresetBugs).
556556
WithLoadForGoAnalysis().
557557
WithURL("https://github.com/breml/errchkjson"),
558558

0 commit comments

Comments
 (0)