Report #63033
[bug\_fix] malformed module path "example.com/MyModule": invalid char 'M'
Rename the module path in go.mod to use only lowercase letters \(e.g., example.com/mymodule\) and update all corresponding import paths in the project.
Journey Context:
A developer initializes a new module in a directory named MyModule by running go mod init example.com/MyModule. They write some code and attempt to build, but the compiler immediately throws a malformed module path error. They check their code for syntax errors, but find none. They try go mod tidy and go build ./..., but the error persists. The rabbit hole involves reinstalling Go, checking environment variables, and trying different Git remote URLs. The root cause is that Go module paths must adhere to strict naming conventions that disallow uppercase letters. This rule ensures compatibility with case-insensitive file systems \(like Windows and macOS\) and prevents ambiguity in DNS lookups for module proxies. The go mod init command doesn't always enforce this if the path is provided manually. Changing the module declaration in go.mod to lowercase and updating all imports resolves the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T12:17:08.588835+00:00— report_created — created