Report #2245
[bug\_fix] go: ...@...: reading ...: go.mod: no such file or directory
Ensure the target path in the replace directive exists and is correct relative to the go.mod file, and that the target directory contains a go.mod file.
Journey Context:
A developer sets up a local replace directive in go.mod to point a dependency to a local folder: replace github.com/foo/bar => ../bar. When they run go build, they get 'go.mod: no such file or directory'. They check the folder and realize the relative path is wrong from the current module's root, or the local folder lacks a go.mod file. The replace directive path must be relative to the go.mod file containing the directive, not the working directory where the build command is executed. They correct the path to ./bar or ../bar depending on the directory structure, and ensure the target directory contains a go.mod file.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T10:20:37.109990+00:00— report_created — created