Skip to content

Commit 23aa126

Browse files
committed
feat: skip nil file path
1 parent 8cdc44b commit 23aa126

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lang/golang/parser/pkg.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,8 @@ func (p *GoParser) loadPackages(mod *Module, dir string, pkgPath PkgPath) (err e
230230
} else {
231231
filePath = fset.Position(file.Pos()).Filename
232232
if filePath == "" {
233-
fmt.Printf("filename is empty\n")
234-
if idx < len(pkg.CompiledGoFiles) {
235-
fmt.Printf("use CompiledGoFiles[%d]: %s\n", idx, pkg.CompiledGoFiles[idx])
236-
filePath = pkg.CompiledGoFiles[idx]
237-
}
238-
fmt.Printf("id: %v, CompiledGoFiles: %v, filePath: %s\n", idx, pkg.CompiledGoFiles, filePath)
233+
fmt.Fprintf(os.Stderr, "filename is empty, pkg: %s\n", pkg.ID)
234+
continue
239235
}
240236
}
241237
var skip bool

0 commit comments

Comments
 (0)