Skip to content

Commit 2ee4944

Browse files
committed
review
1 parent 4262635 commit 2ee4944

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.golangci.next.reference.yml

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ linters:
114114
- unparam
115115
- unused
116116
- usestdlibvars
117+
- usetesting
117118
- varnamelen
118119
- wastedassign
119120
- whitespace
@@ -230,6 +231,7 @@ linters:
230231
- unparam
231232
- unused
232233
- usestdlibvars
234+
- usetesting
233235
- varnamelen
234236
- wastedassign
235237
- whitespace

pkg/golinters/usetesting/usetesting.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ import (
88
"github.com/golangci/golangci-lint/pkg/goanalysis"
99
)
1010

11-
func New(cfg *config.UseTestingSettings) *goanalysis.Linter {
11+
func New(settings *config.UseTestingSettings) *goanalysis.Linter {
1212
a := usetesting.NewAnalyzer()
1313

14-
cfgMap := make(map[string]map[string]any)
15-
if cfg != nil {
16-
cfgMap[a.Name] = map[string]any{
17-
"contextbackground": cfg.ContextBackground,
18-
"contexttodo": cfg.ContextTodo,
19-
"oschdir": cfg.OSChdir,
20-
"osmkdirtemp": cfg.OSMkdirTemp,
21-
"ossetenv": cfg.OSSetenv,
14+
cfg := make(map[string]map[string]any)
15+
if settings != nil {
16+
cfg[a.Name] = map[string]any{
17+
"contextbackground": settings.ContextBackground,
18+
"contexttodo": settings.ContextTodo,
19+
"oschdir": settings.OSChdir,
20+
"osmkdirtemp": settings.OSMkdirTemp,
21+
"ossetenv": settings.OSSetenv,
2222
}
2323
}
2424

2525
return goanalysis.NewLinter(
2626
a.Name,
2727
a.Doc,
2828
[]*analysis.Analyzer{a},
29-
cfgMap,
29+
cfg,
3030
).WithLoadMode(goanalysis.LoadModeTypesInfo)
3131
}

0 commit comments

Comments
 (0)