Skip to content

Commit

Permalink
fix: add check for ""
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Jan 30, 2024
1 parent 41e58e2 commit 1e2db0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ func (f *GoFile) enumPackages() error {

if needFilepath {
fp, _, _ := tab.PCToLine(n.Entry)
if fp == "<autogenerated>" {
switch fp {
case "<autogenerated>", "":
p.Filepath = fp
} else {
default:
p.Filepath = path.Dir(fp)
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func isGeneratedPackage(pkg *Package) bool {
return true
}

// Special case for no package name and path of ".".
// Special case for no package name and path of "".
if pkg.Name == "" && pkg.Filepath == "" {
return true
}
Expand Down

0 comments on commit 1e2db0c

Please sign in to comment.