1
0
mirror of https://github.com/golang/go synced 2024-11-19 00:54:42 -07:00

net/http: use reflect.TypeFor for known types

For #60088

Change-Id: I9e4044d9c2694fe86aab1f5220622c8d952b1a90
Reviewed-on: https://go-review.googlesource.com/c/go/+/522338
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor 2023-08-23 15:57:48 -07:00 committed by Gopher Robot
parent 88cb17e106
commit a5ab4a9471

View File

@ -112,8 +112,8 @@ func (w *mockTransferWriter) Write(p []byte) (int, error) {
}
func TestTransferWriterWriteBodyReaderTypes(t *testing.T) {
fileType := reflect.TypeOf(&os.File{})
bufferType := reflect.TypeOf(&bytes.Buffer{})
fileType := reflect.TypeFor[*os.File]()
bufferType := reflect.TypeFor[*bytes.Buffer]()
nBytes := int64(1 << 10)
newFileFunc := func() (r io.Reader, done func(), err error) {