diff options
| author | apocelipes <seve3r@outlook.com> | 2024-07-24 10:24:06 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-07-25 00:23:03 +0000 |
| commit | 0b0dfcd5404ce86d6c818d78bdb6348ded459e96 (patch) | |
| tree | f7c8fc3cb49a90afd15e14aec43ca763c301c4b8 /src/runtime/metrics | |
| parent | 2247afc0aee41434a4e874af07d026f828bd3210 (diff) | |
| download | go-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/metrics')
| -rw-r--r-- | src/runtime/metrics/description_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
