Skip to content

Commit

Permalink
Ignore invalid source file when generating errdoc
Browse files Browse the repository at this point in the history
Signed-off-by: Lonng <[email protected]>
  • Loading branch information
lonng authored and lucklove committed Oct 30, 2020
1 parent 3aada93 commit 8523de9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/errdoc/errdoc-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ func errdoc(source, module string) ([]*errDecl, error) {
fset := token.NewFileSet()
file, err := parser.ParseFile(fset, path, nil, parser.ParseComments)
if err != nil {
return err
// Ignore invalid source file
return nil
}
errNames := export(file)
if len(errNames) < 1 {
Expand Down

0 comments on commit 8523de9

Please sign in to comment.