For #36460
Change-Id: Ia8633f37aec8c7ed532bf7278867251e5e2a4285
Reviewed-on: https://go-review.googlesource.com/c/go/+/301370
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
// request that their test dependencies be included.
modload.ForceUseModules = true
modload.RootMode = modload.NeedRoot
+ modload.DisallowWriteGoMod() // Suppress writing until we've tidied the file.
modload.LoadPackages(ctx, modload.PackageOpts{
Tags: imports.AnyTags(),
modload.TidyBuildList()
modload.TrimGoSum()
+
+ modload.AllowWriteGoMod()
modload.WriteGoMod()
}