Run go list -m or go mod download in a directory with a malformed go.mod file. The commands are run with arguments that should not require information about the main module or the build list, so it shouldn't actually be necessary to read go.mod.
go list -m -versions golang.org/x/mod
go mod download email@example.com
-- go.mod --
What did you expect to see?
Both commands should succeed.
What did you see instead?
Both commands fail with an error like the one below: