From 8523de90c4833f83277b6ce5cd9aaf2c4a0c173e Mon Sep 17 00:00:00 2001 From: Lonng Date: Tue, 20 Oct 2020 23:42:13 -0400 Subject: [PATCH] Ignore invalid source file when generating errdoc Signed-off-by: Lonng --- components/errdoc/errdoc-gen/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/errdoc/errdoc-gen/main.go b/components/errdoc/errdoc-gen/main.go index 42be8daf55..1b950c5245 100644 --- a/components/errdoc/errdoc-gen/main.go +++ b/components/errdoc/errdoc-gen/main.go @@ -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 {