diff options
| author | Austin Clements <austin@google.com> | 2023-08-24 16:48:14 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2023-10-09 20:51:16 +0000 |
| commit | 262b8050daf588cd298527114cb377753f0a2c39 (patch) | |
| tree | 4d70ca286cd771dc68418912d94ebf288e8fc3cd /src | |
| parent | 8222423e0384cce56de31fe2c38572da0a5c1943 (diff) | |
| download | go-262b8050daf588cd298527114cb377753f0a2c39.tar.xz | |
cmd/go: remove unnecessary b.Print setting
The Builder returned by work.NewBuilder is already setup to print to
os.Stderr, so it's not necessary for runRun to set b.Print to a
different function that does exactly the same thing.
This b.Print assignment was introduced in CL 5591045. At the time, the
builder type defaulted to printing to os.Stdout, so this was necessary
to make "go run" print build errors to stderr.
Change-Id: I0c07984616c5efc37ba681f4cf69e83542566bab
Reviewed-on: https://go-review.googlesource.com/c/go/+/522796
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/internal/run/run.go | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/cmd/go/internal/run/run.go b/src/cmd/go/internal/run/run.go index 4a3dcf0f1a..aabbf016b2 100644 --- a/src/cmd/go/internal/run/run.go +++ b/src/cmd/go/internal/run/run.go @@ -7,9 +7,7 @@ package run import ( "context" - "fmt" "go/build" - "os" "path" "path/filepath" "strings" @@ -75,10 +73,6 @@ func init() { CmdRun.Flag.Var((*base.StringsFlag)(&work.ExecCmd), "exec", "") } -func printStderr(args ...any) (int, error) { - return fmt.Fprint(os.Stderr, args...) -} - func runRun(ctx context.Context, cmd *base.Command, args []string) { if shouldUseOutsideModuleMode(args) { // Set global module flags for 'go run cmd@version'. @@ -100,7 +94,6 @@ func runRun(ctx context.Context, cmd *base.Command, args []string) { base.Fatal(err) } }() - b.Print = printStderr i := 0 for i < len(args) && strings.HasSuffix(args[i], ".go") { |
