From: Mauri de Souza Meneguzzo
Date: Tue, 12 Dec 2023 21:32:10 +0000 (+0000)
Subject: doc/go1.22: document reflect.TypeFor
X-Git-Tag: go1.22rc1~22
X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7cac742f1769f92313eac2188088c36d4aae1b74;p=gostls13.git
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
---
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]()
.