Skip to content

Commit

Permalink
Revert "cmd/go/internal/test: wrap os.Stdout always"
Browse files Browse the repository at this point in the history
This reverts CL 400877.

Reason for revert: broke TestScript/test_output_wait and the
regression test for #18153 on certain builders.

Fixes #52461.

Change-Id: I98627ce5e22088b0784be502c459480c41ba353a
Reviewed-on: https://go-review.googlesource.com/c/go/+/401494
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
  • Loading branch information
Bryan Mills authored and gopherbot committed Apr 21, 2022
1 parent b941a10 commit 1158520
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
6 changes: 1 addition & 5 deletions src/cmd/go/internal/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1261,11 +1261,7 @@ func (c *runCache) builderRunTest(b *work.Builder, ctx context.Context, a *work.
return nil
}

// The os/exec package treats an *os.File differently to an io.Writer.
// Embed os.Stdout in an io.Writer struct so that we get the same
// behavior regardless of whether we wrap it below.
// See golang.org/issue/24050
var stdout io.Writer = struct{ io.Writer }{os.Stdout}
var stdout io.Writer = os.Stdout
var err error
if testJSON {
json := test2json.NewConverter(lockedStdout{}, a.Package.ImportPath, test2json.Timestamp)
Expand Down
35 changes: 0 additions & 35 deletions src/cmd/go/testdata/script/test_output_wait.txt

This file was deleted.

0 comments on commit 1158520

Please sign in to comment.