aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/clientserver_test.go
diff options
context:
space:
mode:
authorapocelipes <seve3r@outlook.com>2024-07-24 10:39:48 +0000
committerGopher Robot <gobot@golang.org>2024-07-25 00:20:13 +0000
commit1d717951f518a9e818e8b98d4daed17756c394ca (patch)
tree9d0d3097e9f47c5e89171e15d05706ea55e2c9ee /src/net/http/clientserver_test.go
parent792a26130347c9b9db344ba56f86645679a1a9d9 (diff)
downloadgo-1d717951f518a9e818e8b98d4daed17756c394ca.tar.xz
net: use slices and maps to clean up tests
Replace reflect.DeepEqual with slices.Equal/maps.Equal, which is much faster. Change-Id: I54600fb63a56460c11d3d5af9072da585e31b1a2 GitHub-Last-Rev: 08c1445ad5be94d071e8ceb4b060b8f4ab0d77ba GitHub-Pull-Request: golang/go#67606 Reviewed-on: https://go-review.googlesource.com/c/go/+/587816 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/net/http/clientserver_test.go')
-rw-r--r--src/net/http/clientserver_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go
index 3dc440dde1..0c2142a063 100644
--- a/src/net/http/clientserver_test.go
+++ b/src/net/http/clientserver_test.go
@@ -274,7 +274,7 @@ func testChunkedResponseHeaders(t *testing.T, mode testMode) {
if mode == http2Mode {
wantTE = nil
}
- if !reflect.DeepEqual(res.TransferEncoding, wantTE) {
+ if !slices.Equal(res.TransferEncoding, wantTE) {
t.Errorf("TransferEncoding = %v; want %v", res.TransferEncoding, wantTE)
}
if got, haveCL := res.Header["Content-Length"]; haveCL {