From a5ab4a9471d6745b604a0dc480524229106b0728 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 23 Aug 2023 15:57:48 -0700 Subject: [PATCH] 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 Reviewed-by: Damien Neil Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Auto-Submit: Ian Lance Taylor --- src/net/http/transfer_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/http/transfer_test.go b/src/net/http/transfer_test.go index 20cc7b5d50b..3f9ebdea7bb 100644 --- a/src/net/http/transfer_test.go +++ b/src/net/http/transfer_test.go @@ -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) {