mirror of
https://github.com/golang/go
synced 2024-11-11 19:21:37 -07:00
feedback
This commit is contained in:
parent
61672c99a0
commit
becd714c45
@ -1 +1 @@
|
||||
pkg reflect, func TypeFor[$0 interface{}]() Type
|
||||
pkg reflect, func TypeFor[$0 interface{}]() Type #60088
|
||||
|
@ -2910,7 +2910,7 @@ func addTypeBits(bv *bitVector, offset uintptr, t *abi.Type) {
|
||||
}
|
||||
}
|
||||
|
||||
// TypeFor returns the reflection Type that represents the static type of T.
|
||||
// TypeFor returns the [Type] that represents the type argument T.
|
||||
func TypeFor[T any]() Type {
|
||||
return TypeOf((*T)(nil)).Elem()
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ func TestTypeFor(t *testing.T) {
|
||||
for _, tc := range testcases {
|
||||
want := reflect.ValueOf(tc.wantFrom).Elem().Type()
|
||||
if want != tc.got {
|
||||
t.Errorf("unexpected reflect.Type: want %v; got %v", want, tc.got)
|
||||
t.Errorf("unexpected reflect.Type: got %v; want %v", tc.got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user