Skip to content

Commit

Permalink
fix: fallback on error
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 27, 2024
1 parent f7a611c commit 3196e58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ func FindModuleFromPass(pass *analysis.Pass) (ModInfo, error) {
break
}

// no Go file found in analysis pass
if name == "" {
return ModInfo{}, errors.New("no Go file found in analysis pass")
name, _ = os.Getwd()
}

for _, info := range infos {
Expand Down

0 comments on commit 3196e58

Please sign in to comment.