aboutsummaryrefslogtreecommitdiff
path: root/src/io
diff options
context:
space:
mode:
authorapocelipes <seve3r@outlook.com>2024-07-24 10:39:58 +0000
committerGopher Robot <gobot@golang.org>2024-07-25 00:22:14 +0000
commit2247afc0aee41434a4e874af07d026f828bd3210 (patch)
tree939cfa7ec182e2c0fb80c1125841ee54c50e48a9 /src/io
parent1d717951f518a9e818e8b98d4daed17756c394ca (diff)
downloadgo-2247afc0aee41434a4e874af07d026f828bd3210.tar.xz
go,internal,io,mime: use slices and maps to clean tests
Replace reflect.DeepEqual with slices.Equal/maps.Equal, which is much faster. Change-Id: Id9cb550884da817da96befdeccfecb3325fb4414 GitHub-Last-Rev: 7d64d78feb86e3ea1af6c24ea6782cb85731bb52 GitHub-Pull-Request: golang/go#67612 Reviewed-on: https://go-review.googlesource.com/c/go/+/587819 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/io')
-rw-r--r--src/io/fs/walk_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/io/fs/walk_test.go b/src/io/fs/walk_test.go
index 40f4e1ab9d..4934df164b 100644
--- a/src/io/fs/walk_test.go
+++ b/src/io/fs/walk_test.go
@@ -9,7 +9,7 @@ import (
"os"
pathpkg "path"
"path/filepath"
- "reflect"
+ "slices"
"testing"
"testing/fstest"
)
@@ -145,7 +145,7 @@ func TestIssue51617(t *testing.T) {
t.Fatal(err)
}
want := []string{".", "a", "a/bad", "a/next"}
- if !reflect.DeepEqual(saw, want) {
+ if !slices.Equal(saw, want) {
t.Errorf("got directories %v, want %v", saw, want)
}
}