Skip to content

Commit 846c9ff

Browse files
committed
[Issue 159] Allow loader errors so that processing continues if there's a package loading problem.
1 parent 07a2eec commit 846c9ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

analyzer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ func (gas *Analyzer) LoadRules(ruleDefinitions ...RuleBuilder) {
9696

9797
// Process kicks off the analysis process for a given package
9898
func (gas *Analyzer) Process(packagePaths ...string) error {
99-
packageConfig := loader.Config{Build: &build.Default, ParserMode: parser.ParseComments}
99+
packageConfig := loader.Config{
100+
Build: &build.Default,
101+
ParserMode: parser.ParseComments,
102+
AllowErrors: true,
103+
}
100104
for _, packagePath := range packagePaths {
101105
abspath, _ := filepath.Abs(packagePath)
102106
gas.logger.Println("Searching directory:", abspath)

0 commit comments

Comments
 (0)