Skip to content

Commit

Permalink
utils.io: revert last change
Browse files Browse the repository at this point in the history
  • Loading branch information
yusing committed Feb 28, 2025
1 parent 09db57d commit 9c04065
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions internal/utils/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,6 @@ const (
// This is a copy of io.Copy with context and HTTP flusher handling
// Author: yusing <[email protected]>.
func CopyClose(dst *ContextWriter, src *ContextReader) (err error) {
// If the reader has a WriteTo method, use it to do the copy.
// Avoids an allocation and a copy.
if wt, ok := src.Reader.(io.WriterTo); ok {
_, err = wt.WriteTo(dst)
return
}
// Similarly, if the writer has a ReadFrom method, use it to do the copy.
if rf, ok := dst.Writer.(io.ReaderFrom); ok {
_, err = rf.ReadFrom(src)
return
}
var buf []byte
if l, ok := src.Reader.(*io.LimitedReader); ok {
size := copyBufSize
Expand Down

0 comments on commit 9c04065

Please sign in to comment.