From 23c9efa24446186562ec23c1af7c9a549bc18362 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek <mknyszek@google.com> Date: Wed, 21 Aug 2024 14:42:33 +0000 Subject: [PATCH] unique: clean up handle test code Currently the handle test code has a lot of duplicate type parameters that are already inferred. This results in IDE warnings which are annoying. Clean this up by consistently explicitly calling out the type in the argument, not the type parameter. Change-Id: I756203f37fc97c793cd5c5e612c6fd1802a84bc1 Reviewed-on: https://go-review.googlesource.com/c/go/+/607356 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> --- src/unique/handle_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/unique/handle_test.go b/src/unique/handle_test.go index b031bbf6852..ffb2be42b12 100644 --- a/src/unique/handle_test.go +++ b/src/unique/handle_test.go @@ -30,18 +30,18 @@ type testStruct struct { } func TestHandle(t *testing.T) { - testHandle[testString](t, "foo") - testHandle[testString](t, "bar") - testHandle[testString](t, "") - testHandle[testIntArray](t, [4]int{7, 77, 777, 7777}) - testHandle[testEface](t, nil) - testHandle[testStringArray](t, [3]string{"a", "b", "c"}) - testHandle[testStringStruct](t, testStringStruct{"x"}) - testHandle[testStringStructArrayStruct](t, testStringStructArrayStruct{ - s: [2]testStringStruct{testStringStruct{"y"}, testStringStruct{"z"}}, + testHandle(t, testString("foo")) + testHandle(t, testString("bar")) + testHandle(t, testString("")) + testHandle(t, testIntArray{7, 77, 777, 7777}) + testHandle(t, testEface(nil)) + testHandle(t, testStringArray{"a", "b", "c"}) + testHandle(t, testStringStruct{"x"}) + testHandle(t, testStringStructArrayStruct{ + s: [2]testStringStruct{{"y"}, {"z"}}, }) - testHandle[testStruct](t, testStruct{0.5, "184"}) - testHandle[testEface](t, testEface("hello")) + testHandle(t, testStruct{0.5, "184"}) + testHandle(t, testEface("hello")) } func testHandle[T comparable](t *testing.T, value T) { -- GitLab