Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Aug 23, 2022
1 parent 94a9c43 commit 8576746
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pkg/golinters/contextcheck.go
Expand Up @@ -9,15 +9,14 @@ import (
)

func NewContextCheck() *goanalysis.Linter {
conf := contextcheck.Configuration{}
analyzer := contextcheck.NewAnalyzer(conf)
analyzer := contextcheck.NewAnalyzer(contextcheck.Configuration{})

return goanalysis.NewLinter(
"contextcheck",
"check the function whether use a non-inherited context",
analyzer.Name,
analyzer.Doc,
[]*analysis.Analyzer{analyzer},
nil,
).WithLoadMode(goanalysis.LoadModeTypesInfo).
WithContextSetter(func(lintCtx *linter.Context) {
analyzer.Run = contextcheck.NewRun(lintCtx.Packages, conf.DisableFact)
})
).WithContextSetter(func(lintCtx *linter.Context) {
analyzer.Run = contextcheck.NewRun(lintCtx.Packages, false)
}).WithLoadMode(goanalysis.LoadModeTypesInfo)
}

0 comments on commit 8576746

Please sign in to comment.