Skip to content

Commit 22d6df9

Browse files
committed
feat: ignore parse file err
1 parent b03e2cf commit 22d6df9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/parser/method.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"go/parser"
77
"go/token"
88
"io/ioutil"
9+
"log"
910
"strings"
1011
)
1112

@@ -135,7 +136,8 @@ func (m *DIYMethods) LoadMethods() error {
135136
for _, filename := range m.pkgFiles {
136137
f, err := parser.ParseFile(token.NewFileSet(), filename, nil, parser.ParseComments)
137138
if err != nil {
138-
return fmt.Errorf("can't parse file %q: %s", filename, err)
139+
log.Printf("can't parse file %q: %s", filename, err)
140+
continue
139141
}
140142
m.currentFile = filename
141143
ast.Walk(m, f)

0 commit comments

Comments
 (0)