Skip to content

Commit

Permalink
Revert "io: detect Writers that access io.Copy's buffer after returning"
Browse files Browse the repository at this point in the history
This reverts CL 466865.

Reason for revert: Causing trybot flakiness due to net/http race,
roll back until net/http is fixed.

For golang#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>
  • Loading branch information
neild authored and johanbrandhorst committed Feb 22, 2023
1 parent 2c9c3b6 commit e3f013e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/io/io.go
Expand Up @@ -14,7 +14,6 @@ package io

import (
"errors"
"internal/race"
"sync"
)

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e3f013e

Please sign in to comment.