mirror of https://github.com/golang/go.git
fixes
This commit is contained in:
parent
c7f2166f06
commit
1d9fe39d0c
|
|
@ -717,9 +717,10 @@ defer func() {
|
|||
<p><!-- https://go.dev/issue/60088, CL 513478 -->
|
||||
The new function <a href="/pkg/reflect/#TypeFor"><code>TypeFor</code></a>
|
||||
returns the <a href="/pkg/reflect/#Type"><code>Type</code></a> that represents
|
||||
the type argument T. Previously, to get the element type, one had to use
|
||||
<code>reflect.TypeOf((*T)(nil)).Elem()</code>, this can now be written quite
|
||||
nicely with <code>reflect.TypeFor[T]()</code>.
|
||||
the type argument T.
|
||||
Previously, to get the <code>reflect.Type</code> value for a type, one had to use
|
||||
<code>reflect.TypeOf((*T)(nil)).Elem()</code>.
|
||||
This may now be written as <code>reflect.TypeFor[T]()</code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- reflect -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue