From 7cac742f1769f92313eac2188088c36d4aae1b74 Mon Sep 17 00:00:00 2001 From: Mauri de Souza Meneguzzo Date: Tue, 12 Dec 2023 21:32:10 +0000 Subject: [PATCH] doc/go1.22: document reflect.TypeFor 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 Auto-Submit: Michael Knyszek LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- doc/go1.22.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/go1.22.html b/doc/go1.22.html index 9cea5ba8c2..1ac0e7e6ee 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -728,8 +728,13 @@ defer func() { in favor of PointerTo.

-

- TODO: https://go.dev/issue/60088: reflect: add TypeFor +

+ The new function TypeFor + returns the Type that represents + the type argument T. + Previously, to get the reflect.Type value for a type, one had to use + reflect.TypeOf((*T)(nil)).Elem(). + This may now be written as reflect.TypeFor[T]().

-- 2.50.0