Skip to content
This repository was archived by the owner on Mar 15, 2025. It is now read-only.

Commit 3196e58

Browse files
committed
fix: fallback on error
1 parent f7a611c commit 3196e58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

module.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ func FindModuleFromPass(pass *analysis.Pass) (ModInfo, error) {
121121
break
122122
}
123123

124+
// no Go file found in analysis pass
124125
if name == "" {
125-
return ModInfo{}, errors.New("no Go file found in analysis pass")
126+
name, _ = os.Getwd()
126127
}
127128

128129
for _, info := range infos {

0 commit comments

Comments
 (0)