Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lang/golang/parser/ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (p *GoParser) getFileBytes(path string) []byte {
}
bs, err := os.ReadFile(path)
if err != nil {
panic(err)
panic(fmt.Sprintf("read file %s failed: %v", path, err))
}
p.files[path] = bs
return bs
Expand Down
4 changes: 4 additions & 0 deletions lang/golang/parser/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ func (p *GoParser) loadPackages(mod *Module, dir string, pkgPath PkgPath) (err e
filePath = pkg.CompiledGoFiles[idx]
} else {
filePath = fset.Position(file.Pos()).Filename
if filePath == "" {
fmt.Fprintf(os.Stderr, "filename is empty, pkg: %s\n", pkg.ID)
continue
}
}
var skip bool
for _, exclude := range p.exclues {
Expand Down
Loading