aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/callers_test.go
diff options
context:
space:
mode:
authorapocelipes <seve3r@outlook.com>2024-07-24 10:24:06 +0000
committerGopher Robot <gobot@golang.org>2024-07-25 00:23:03 +0000
commit0b0dfcd5404ce86d6c818d78bdb6348ded459e96 (patch)
treef7c8fc3cb49a90afd15e14aec43ca763c301c4b8 /src/runtime/callers_test.go
parent2247afc0aee41434a4e874af07d026f828bd3210 (diff)
downloadgo-0b0dfcd5404ce86d6c818d78bdb6348ded459e96.tar.xz
runtime: use slices and maps to clean up tests
Replace reflect.DeepEqual with slices.Equal/maps.Equal, which is much faster. Also remove some unecessary helper functions. Change-Id: I3e4fa2938fed1598278c9e556cd4fa3b9ed3ad6d GitHub-Last-Rev: 69bb43fc6e5c4a4a7d028528fe00b43db784464e GitHub-Pull-Request: golang/go#67603 Reviewed-on: https://go-review.googlesource.com/c/go/+/587815 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> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/runtime/callers_test.go')
-rw-r--r--src/runtime/callers_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/callers_test.go b/src/runtime/callers_test.go
index 49a1d5a6f7..9429442fc0 100644
--- a/src/runtime/callers_test.go
+++ b/src/runtime/callers_test.go
@@ -5,8 +5,8 @@
package runtime_test
import (
- "reflect"
"runtime"
+ "slices"
"strings"
"testing"
)
@@ -80,7 +80,7 @@ func testCallersEqual(t *testing.T, pcs []uintptr, want []string) {
}
got = append(got, frame.Function)
}
- if !reflect.DeepEqual(want, got) {
+ if !slices.Equal(want, got) {
t.Fatalf("wanted %v, got %v", want, got)
}
}