diff options
| author | apocelipes <seve3r@outlook.com> | 2024-07-24 10:39:48 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-07-25 00:20:13 +0000 |
| commit | 1d717951f518a9e818e8b98d4daed17756c394ca (patch) | |
| tree | 9d0d3097e9f47c5e89171e15d05706ea55e2c9ee /src/net/http/cgi | |
| parent | 792a26130347c9b9db344ba56f86645679a1a9d9 (diff) | |
| download | go-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/cgi')
| -rw-r--r-- | src/net/http/cgi/host_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/http/cgi/host_test.go b/src/net/http/cgi/host_test.go index 7fe0e6257d..8ecfa19f6b 100644 --- a/src/net/http/cgi/host_test.go +++ b/src/net/http/cgi/host_test.go @@ -16,9 +16,9 @@ import ( "net/http/httptest" "os" "path/filepath" - "reflect" "regexp" "runtime" + "slices" "strings" "testing" "time" @@ -510,7 +510,7 @@ func TestRemoveLeadingDuplicates(t *testing.T) { } for _, tt := range tests { got := removeLeadingDuplicates(tt.env) - if !reflect.DeepEqual(got, tt.want) { + if !slices.Equal(got, tt.want) { t.Errorf("removeLeadingDuplicates(%q) = %q; want %q", tt.env, got, tt.want) } } |
