cmd/go: add loaderstate as field on `QueryMatchesMainModulesError`
This change modifies the type `QueryMatchesMainModulesError` to have
an additional field to store the current module loader state. The
field is used to break the dependency on the global
`modload.LoaderState` variable.
This commit is part of the overall effort to eliminate global
modloader state.
Change-Id: Ia2066fab9f3ec4ffdd3d7393dacdf65c0fd35b92
Reviewed-on: https://go-review.googlesource.com/c/go/+/711118
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>