aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/load.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2023-05-31 09:57:03 -0400
committerGopher Robot <gobot@golang.org>2023-05-31 15:21:16 +0000
commite73e5d80ea371a67f7b10725e623940a3dcd4924 (patch)
treedf7bdefb65483963fb388d8d4903c8a4a0d5046c /src/cmd/go/internal/modload/load.go
parent51114a3fa58b196ec5ab4b5205617f98e2cdc5ff (diff)
downloadgo-e73e5d80ea371a67f7b10725e623940a3dcd4924.tar.gz
go-e73e5d80ea371a67f7b10725e623940a3dcd4924.zip
cmd/go: introduce WriteOpts argument for WriteGoMod
This CL is a no-op, just adding the new options and plumbing it through. 'go get' will use this option to let commitRequirements know whether toolchain was mentioned explicitly on the command line. For #57001. Change-Id: Iee7145f3335e899704df3e98fb840f1aa4063b0c Reviewed-on: https://go-review.googlesource.com/c/go/+/499555 Run-TryBot: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/go/internal/modload/load.go')
-rw-r--r--src/cmd/go/internal/modload/load.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go
index 6c888116fe..b4cf736d75 100644
--- a/src/cmd/go/internal/modload/load.go
+++ b/src/cmd/go/internal/modload/load.go
@@ -450,7 +450,7 @@ func LoadPackages(ctx context.Context, opts PackageOpts, patterns ...string) (ma
sort.Strings(loadedPackages)
if !ExplicitWriteGoMod && opts.ResolveMissingImports {
- if err := commitRequirements(ctx); err != nil {
+ if err := commitRequirements(ctx, WriteOpts{}); err != nil {
base.Fatalf("go: %v", err)
}
}
@@ -733,7 +733,7 @@ func ImportFromFiles(ctx context.Context, gofiles []string) {
requirements = loaded.requirements
if !ExplicitWriteGoMod {
- if err := commitRequirements(ctx); err != nil {
+ if err := commitRequirements(ctx, WriteOpts{}); err != nil {
base.Fatalf("go: %v", err)
}
}