Change-Id: I122a3422f541f66d9f6e644a9f287f0e5a5729d2
GitHub-Last-Rev:
1d9fe39d0c1221d7179476383f3d503e45daa051
GitHub-Pull-Request: golang/go#64688
Reviewed-on: https://go-review.googlesource.com/c/go/+/549295
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
in favor of <a href="/pkg/reflect/#PointerTo"><code>PointerTo</code></a>.
</p>
- <p><!-- https://go.dev/issue/60088 -->
- TODO: <a href="https://go.dev/issue/60088">https://go.dev/issue/60088</a>: reflect: add TypeFor
+ <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 <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 -->