Skip to content

Commit 2e1ba6d

Browse files
ldezMirrexOne
authored andcommitted
review
1 parent ff080c8 commit 2e1ba6d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/golinters/gounqvet/gounqvet.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import (
99
)
1010

1111
func New(settings *config.GounqvetSettings) *goanalysis.Linter {
12-
var cfg *pkgconfig.GounqvetSettings
12+
cfg := pkgconfig.DefaultSettings()
1313

1414
if settings != nil {
15-
cfg = &pkgconfig.GounqvetSettings{
16-
CheckSQLBuilders: settings.CheckSQLBuilders,
17-
AllowedPatterns: settings.AllowedPatterns,
15+
cfg.CheckSQLBuilders = settings.CheckSQLBuilders
16+
if len(settings.AllowedPatterns) > 0 {
17+
cfg.AllowedPatterns = settings.AllowedPatterns
1818
}
1919
}
2020

2121
return goanalysis.
22-
NewLinterFromAnalyzer(gounqvet.NewWithConfig(cfg)).
22+
NewLinterFromAnalyzer(gounqvet.NewWithConfig(&cfg)).
2323
WithLoadMode(goanalysis.LoadModeSyntax)
2424
}

0 commit comments

Comments
 (0)