From f111d5de2c5e8255c9a74184fa8481c580de55fd Mon Sep 17 00:00:00 2001 From: Jon McClintock Date: Mon, 29 Jan 2018 18:33:48 +0000 Subject: [PATCH] [Issue 159] Allow loader errors so that processing continues if there's a package loading problem. --- analyzer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/analyzer.go b/analyzer.go index f050ab79f8..e3368696e2 100644 --- a/analyzer.go +++ b/analyzer.go @@ -96,7 +96,11 @@ func (gas *Analyzer) LoadRules(ruleDefinitions ...RuleBuilder) { // Process kicks off the analysis process for a given package func (gas *Analyzer) Process(packagePaths ...string) error { - packageConfig := loader.Config{Build: &build.Default, ParserMode: parser.ParseComments} + packageConfig := loader.Config{ + Build: &build.Default, + ParserMode: parser.ParseComments, + AllowErrors: true, + } for _, packagePath := range packagePaths { abspath, _ := filepath.Abs(packagePath) gas.logger.Println("Searching directory:", abspath)