diff options
| author | Cherry Mui <cherryyz@google.com> | 2025-12-11 23:22:32 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-12-12 10:40:53 -0800 |
| commit | 8ead8594702c5fb61843b8b91fd2e144eede1297 (patch) | |
| tree | 2adb3d06e51a50807ab357b9af19798a3bd82db5 | |
| parent | b2e7f82fa73e9ec283c13687367ce8d48ce164c6 (diff) | |
| download | go-x-website-8ead8594702c5fb61843b8b91fd2e144eede1297.tar.xz | |
_content/doc/go1.26: reword release notes of new reflect iterators
We don't include the package name on types as it is already
the "reflect" section. Mention the methods explicitly.
For golang/go#75005.
Change-Id: Ia8e31cd1982f9449c9304111cc6c89827b49cd24
Reviewed-on: https://go-review.googlesource.com/c/website/+/729560
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: David Chase <drchase@google.com>
| -rw-r--r-- | _content/doc/go1.26.md | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/_content/doc/go1.26.md b/_content/doc/go1.26.md index 18aaece6..8a1ce850 100644 --- a/_content/doc/go1.26.md +++ b/_content/doc/go1.26.md @@ -566,10 +566,19 @@ and an error indicating which signal was received. #### [`reflect`](/pkg/reflect/) -[`reflect.Type`](/pkg/reflect#Type) includes new methods that return iterators for a type's fields, methods, inputs and outputs. -Similarly, [`reflect.Value`](/pkg/reflect#Value) includes two new methods that return iterators over a value's fields or methods, -each element being a pair of the value ([`reflect.Value`](/pkg/reflect#Value)) and its type information ([`reflect.StructField`](/pkg/reflect#StructField) or -[`reflect.Method`](/pkg/reflect#Method)). +The new methods [`Type.Fields`](/pkg/reflect#Type.Fields), +[`Type.Methods`](/pkg/reflect#Type.Methods), +[`Type.Ins`](/pkg/reflect#Type.Ins) +and [`Type.Outs`](/pkg/reflect#Type.Outs) +return iterators for a type's fields (for a struct type), methods, +inputs and outputs parameters (for a function type), respectively. + +Similarly, the new methods [`Value.Fields`](/pkg/reflect#Value.Fields) +and [`Value.Methods`](/pkg/reflect#Value.Methods) return iterators over +a value's fields or methods, respectively. +Each iteration yields the type information ([`StructField`](/pkg/reflect#StructField) or +[`Method`](/pkg/reflect#Method)) of a field or method, +along with the field or method [`Value`](/pkg/reflect#Value). #### [`runtime/metrics`](/pkg/runtime/metrics/) @@ -605,7 +614,7 @@ For example, in a test named `TestArtifacts`, The new [`SetGlobalRandom`](/pkg/testing/cryptotest#SetGlobalRandom) function configures a global, deterministic cryptographic randomness source for the duration of the test. It affects -crypto/rand, and all implicit sources of cryptographic randomness in the +`crypto/rand`, and all implicit sources of cryptographic randomness in the `crypto/...` packages. #### [`time`](/pkg/time/) |
