Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8576746

Browse files
committedAug 23, 2022
review
1 parent 94a9c43 commit 8576746

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed
 

‎pkg/golinters/contextcheck.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ import (
99
)
1010

1111
func NewContextCheck() *goanalysis.Linter {
12-
conf := contextcheck.Configuration{}
13-
analyzer := contextcheck.NewAnalyzer(conf)
12+
analyzer := contextcheck.NewAnalyzer(contextcheck.Configuration{})
13+
1414
return goanalysis.NewLinter(
15-
"contextcheck",
16-
"check the function whether use a non-inherited context",
15+
analyzer.Name,
16+
analyzer.Doc,
1717
[]*analysis.Analyzer{analyzer},
1818
nil,
19-
).WithLoadMode(goanalysis.LoadModeTypesInfo).
20-
WithContextSetter(func(lintCtx *linter.Context) {
21-
analyzer.Run = contextcheck.NewRun(lintCtx.Packages, conf.DisableFact)
22-
})
19+
).WithContextSetter(func(lintCtx *linter.Context) {
20+
analyzer.Run = contextcheck.NewRun(lintCtx.Packages, false)
21+
}).WithLoadMode(goanalysis.LoadModeTypesInfo)
2322
}

0 commit comments

Comments
 (0)
Please sign in to comment.