From 0b0dfcd5404ce86d6c818d78bdb6348ded459e96 Mon Sep 17 00:00:00 2001 From: apocelipes Date: Wed, 24 Jul 2024 10:24:06 +0000 Subject: 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 LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/runtime/metrics/description_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime/metrics') diff --git a/src/runtime/metrics/description_test.go b/src/runtime/metrics/description_test.go index 4fc652362e..0ee9ea16d0 100644 --- a/src/runtime/metrics/description_test.go +++ b/src/runtime/metrics/description_test.go @@ -18,7 +18,7 @@ import ( "os" "regexp" "runtime/metrics" - "sort" + "slices" "strings" "testing" _ "unsafe" @@ -43,7 +43,7 @@ func TestNames(t *testing.T) { } names := runtime_readMetricNames() - sort.Strings(names) + slices.Sort(names) samples := make([]metrics.Sample, len(names)) for i, name := range names { samples[i].Name = name -- cgit v1.3