Skip to content

Commit 5ae616b

Browse files
committed
Module.PkgType fix: support Default module
1 parent 8a28b64 commit 5ae616b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gopmod/module.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (p *Module) PkgType(pkgPath string) PkgType {
7878
}
7979

8080
func isPkgInMod(pkgPath, modPath string) bool {
81-
if strings.HasPrefix(pkgPath, modPath) {
81+
if modPath != "" && strings.HasPrefix(pkgPath, modPath) {
8282
suffix := pkgPath[len(modPath):]
8383
return suffix == "" || suffix[0] == '/'
8484
}

0 commit comments

Comments
 (0)