diff options
author | Michael Matloob <matloob@golang.org> | 2020-06-17 18:18:23 -0400 |
---|---|---|
committer | Michael Matloob <matloob@golang.org> | 2020-08-17 17:26:57 +0000 |
commit | a26d687ebb23fa14b777ef5bf69b56556124ff3b (patch) | |
tree | a5a4c64ff25148c4bdab5ecdb92f66d353730f3d /src/cmd/go/internal/run/run.go | |
parent | 023d4973851a25e2a47b1ebaf96833c9209efd7c (diff) | |
download | go-a26d687ebb23fa14b777ef5bf69b56556124ff3b.tar.gz go-a26d687ebb23fa14b777ef5bf69b56556124ff3b.zip |
cmd/go: propagate context into Action.Func calls
Action.Func is now a func(*Builder, context.Context, *Action), so that
contexts can be propagated into the action funcs. While context
is traditionally the first parameter of a function, it's the second
parameter of Action.Func's type to continue to allow for methods
on Builder to be used as functions taking a *Builder as the first
parameter. context.Context is instead the first parameter on
those functions.
Change-Id: I5f058d6a99a1e96fe2025f2e8ce30a033d12e935
Reviewed-on: https://go-review.googlesource.com/c/go/+/248321
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <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.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/run/run.go b/src/cmd/go/internal/run/run.go index 3630f68c54..deec5106ff 100644 --- a/src/cmd/go/internal/run/run.go +++ b/src/cmd/go/internal/run/run.go @@ -146,7 +146,7 @@ func runRun(ctx context.Context, cmd *base.Command, args []string) { // buildRunProgram is the action for running a binary that has already // been compiled. We ignore exit status. -func buildRunProgram(b *work.Builder, a *work.Action) error { +func buildRunProgram(b *work.Builder, ctx context.Context, a *work.Action) error { cmdline := str.StringList(work.FindExecCmd(), a.Deps[0].Target, a.Args) if cfg.BuildN || cfg.BuildX { b.Showcmd("", "%s", strings.Join(cmdline, " ")) |