Report #47197
[bug\_fix] go: malformed module path "": missing dot in first path element and no slash in path
Use a fully qualified module path with a dot in the first element \(e.g., \`github.com/user/repo\` instead of \`myrepo\`\), or add a \`replace\` directive in \`go.mod\` to point the malformed module path to a local directory.
Journey Context:
A developer creates a new local module and names it \`module myapp\` in \`go.mod\`. They try to import it from another local module using \`import "myapp"\`. The build fails with a malformed module path error. They wonder why Go cares about a dot in a local project name. The Go module system requires module paths to be valid URL-like paths to avoid namespace collisions and ensure global uniqueness. A path without a dot in the first element \(like \`myapp\` or \`localhost\`\) is not a valid hostname, so Go rejects it as a malformed module path for remote resolution. If it's a local module being imported by another local module, the fix is to add a \`replace\` directive in the consuming module's \`go.mod\` \(e.g., \`replace myapp => ../myapp\`\) so Go knows how to resolve it locally without treating it as a globally resolvable remote path, or better, name the module properly from the start.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:41:30.962457+00:00— report_created — created