Merge pull request #161 from jonmcclintock/allow-loader-errors

[Issue 159] Allow loader errors so that processing continues
This commit is contained in:
Grant Murphy 2018-01-30 09:58:21 +10:00 committed by GitHub
commit a2930983a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,7 +96,11 @@ func (gas *Analyzer) LoadRules(ruleDefinitions ...RuleBuilder) {
// Process kicks off the analysis process for a given package // Process kicks off the analysis process for a given package
func (gas *Analyzer) Process(packagePaths ...string) error { 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 { for _, packagePath := range packagePaths {
abspath, _ := filepath.Abs(packagePath) abspath, _ := filepath.Abs(packagePath)
gas.logger.Println("Searching directory:", abspath) gas.logger.Println("Searching directory:", abspath)