aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/run/run.go
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2021-04-15 18:06:45 -0400
committerJay Conrod <jayconrod@google.com>2021-04-16 14:15:42 +0000
commitdc76c4756599ac4bd9644e407aa2af9f9c8a3bdc (patch)
treef8b57a4e4cee0ca04911f6d0ccd2d727df09ac87 /src/cmd/go/internal/run/run.go
parentcde92846e227425df8258cafade02497a60e421e (diff)
downloadgo-dc76c4756599ac4bd9644e407aa2af9f9c8a3bdc.tar.gz
go-dc76c4756599ac4bd9644e407aa2af9f9c8a3bdc.zip
cmd/go/internal/load: convert two global flags to an options struct
PackageOpts is a new struct type accepted by package loading functions. It initially has two fields: IgnoreImports, and ModResolveTests. Previously, these were global variables set by clients. We'll add more to this in the future. For #40775 Change-Id: I6956e56502de836d3815ce788bdf16fc5f3e5338 Reviewed-on: https://go-review.googlesource.com/c/go/+/310669 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/run/run.go')
-rw-r--r--src/cmd/go/internal/run/run.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/run/run.go b/src/cmd/go/internal/run/run.go
index 666b1a0e56..f0137c20c1 100644
--- a/src/cmd/go/internal/run/run.go
+++ b/src/cmd/go/internal/run/run.go
@@ -77,9 +77,9 @@ func runRun(ctx context.Context, cmd *base.Command, args []string) {
base.Fatalf("go run: cannot run *_test.go files (%s)", file)
}
}
- p = load.GoFilesPackage(ctx, files)
+ p = load.GoFilesPackage(ctx, load.PackageOpts{}, files)
} else if len(args) > 0 && !strings.HasPrefix(args[0], "-") {
- pkgs := load.PackagesAndErrors(ctx, args[:1])
+ pkgs := load.PackagesAndErrors(ctx, load.PackageOpts{}, args[:1])
if len(pkgs) == 0 {
base.Fatalf("go run: no packages loaded from %s", args[0])
}