Accept valid local main module paths

This commit is contained in:
2026-10-10 14:12:50 +00:00
parent c8eb64adec
commit 7eebbbbfc3
4 changed files with 57 additions and 2 deletions

View File

@@ -126,7 +126,7 @@ func Derive(selection Selection, declaration []byte, version string) (Identity,
return identity, fmt.Errorf("selected module declaration has no valid module directive")
}
identity.ModulePath = modulePath
if err := module.CheckPath(modulePath); err != nil {
if err := module.CheckImportPath(modulePath); err != nil {
return identity, fmt.Errorf("invalid module path %q: %w", modulePath, err)
}
_, pathMajor, ok := module.SplitPathVersion(modulePath)