mirror of
https://github.com/golang/go
synced 2024-11-25 11:57:58 -07:00
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>
This commit is contained in:
parent
755c18ecdf
commit
23c9efa244
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user