Report #1293
[bug\_fix] go: example.com/[email protected]...: reading example.com/legacy/go.mod at revision v0.0.0-20230101...: go.mod file not found
Upgrade the dependency to a version that includes a go.mod file, or fork the repository, add a go.mod file, and use a replace directive to point to the fork.
Journey Context:
A developer adds a dependency that hasn't been updated since before Go 1.11. They run go mod tidy and get a 'go.mod file not found' error. They check the repository on GitHub and confirm the code is there, but there's no go.mod. In older Go versions, this would fall back to GOPATH mode, but in Go 1.16\+, the go command strictly requires a go.mod file to define a module's root and path. The developer tries GO111MODULE=off, which breaks their other modern dependencies. The proper fix is to check if the maintainer added a go.mod in a newer branch or commit. If the project is unmaintained, the developer must fork the repository, add a go.mod file declaring the module path, and use a replace directive in their own go.mod to point to the forked version.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-14T15:38:04.131631+00:00— report_created — created