mirror of
https://github.com/securego/gosec.git
synced 2024-12-24 11:35:52 +00:00
Merge pull request #10 from HewlettPackard/issue9
Handle import error rather than panic on failure
This commit is contained in:
commit
50fb7f4217
1 changed files with 4 additions and 1 deletions
|
@ -83,7 +83,10 @@ func (gas *Analyzer) process(filename string, source interface{}) error {
|
|||
|
||||
conf := types.Config{Importer: importer.Default()}
|
||||
gas.context.Pkg, _ = conf.Check("pkg", gas.context.FileSet, []*ast.File{root}, gas.context.Info)
|
||||
// TODO: we need to look at the err ret
|
||||
if err != nil {
|
||||
gas.logger.Println("failed to check imports")
|
||||
return err
|
||||
}
|
||||
|
||||
ast.Walk(gas, root)
|
||||
gas.Stats.NumFiles++
|
||||
|
|
Loading…
Reference in a new issue