Report #85199
[bug\_fix] malformed module path "./utils"
Replace the relative import path with the absolute module path matching the go.mod file \(e.g., import "github.com/user/repo/utils"\).
Journey Context:
A developer working in a monorepo or migrating from older GOPATH code creates a new subdirectory for utilities. Out of habit or due to an IDE misconfiguration, they import it using a relative path like import "./utils". Upon building, Go throws a malformed module path error. The developer might try modifying go.mod to include the relative path, or adjusting GOFLAGS, but this fails because Go modules strictly require absolute import paths rooted in the module's declared path. The fix is to use the full module path defined in go.mod. This works because the Go compiler resolves imports by matching them against the module path prefix, then looking in the local directory structure, completely disallowing relative paths in module mode.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:35:48.663907+00:00— report_created — created