aboutsummaryrefslogtreecommitdiff
path: root/src/io
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2023-02-13 14:35:34 -0800
committerGopher Robot <gobot@golang.org>2023-02-14 16:24:56 +0000
commitb146d7626f869901f9dd841b9253e89a227c6465 (patch)
tree206e171c89d464ec28cde8c73cb0cb93ad62f2a9 /src/io
parent0cd309e12818f988693bf8e4d9f1453331dcf9f2 (diff)
downloadgo-b146d7626f869901f9dd841b9253e89a227c6465.tar.gz
go-b146d7626f869901f9dd841b9253e89a227c6465.zip
Revert "io: detect Writers that access io.Copy's buffer after returning"
This reverts CL 466865. Reason for revert: Causing trybot flakiness due to net/http race, roll back until net/http is fixed. For #58168 Change-Id: I3129deb996abe6466eccf933fe93cbbaf72ae217 Reviewed-on: https://go-review.googlesource.com/c/go/+/467895 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/io')
-rw-r--r--src/io/io.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/io/io.go b/src/io/io.go
index 946ea5b01c..630ab73b56 100644
--- a/src/io/io.go
+++ b/src/io/io.go
@@ -14,7 +14,6 @@ package io
import (
"errors"
- "internal/race"
"sync"
)
@@ -428,14 +427,6 @@ func copyBuffer(dst Writer, src Reader, buf []byte) (written int64, err error) {
nr, er := src.Read(buf)
if nr > 0 {
nw, ew := dst.Write(buf[0:nr])
- if race.Enabled {
- // Write over the buffer to help the race detector
- // detect Write calls that access the buffer after returning.
- // Use something other than zeros to make errors more obvious.
- for i := range buf[:nr] {
- buf[i] = 0xdd
- }
- }
if nw < 0 || nr < nw {
nw = 0
if ew == nil {