]> Cypherpunks repositories - gostls13.git/commit
reflect: add iterator equivalents for NumField, NumIn, NumOut and NumMethod
authorQuentin Quaadgras <quentin@splizard.com>
Wed, 19 Nov 2025 21:18:39 +0000 (21:18 +0000)
committerAlan Donovan <adonovan@google.com>
Tue, 25 Nov 2025 17:18:42 +0000 (09:18 -0800)
commite8fdfeb72b0468b645f256bcaf46570f866a54fd
treec326fe70557a13111b317dc102c261a36f95e168
parent12d437c09a2ea871333547c8ac3ea536f433891b
reflect: add iterator equivalents for NumField, NumIn, NumOut and NumMethod

The new methods are Type.Fields, Type.Methods, Type.Ins, Type.Outs,
Value.Fields and Value.Methods.

These methods have been introduced into the reflect package (as well
as tests) replacing three-clause for loops where possible.

Fixes #66631

Change-Id: Iab346e52c0eadd7817afae96d9ef73a35db65fd2
GitHub-Last-Rev: 8768ef71b9fd74536094cb1072c7075dc732cd5c
GitHub-Pull-Request: golang/go#75646
Reviewed-on: https://go-review.googlesource.com/c/go/+/707356
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
api/next/66631.txt [new file with mode: 0644]
doc/next/6-stdlib/99-minor/reflect/66631.md [new file with mode: 0644]
src/reflect/abi_test.go
src/reflect/all_test.go
src/reflect/benchmark_test.go
src/reflect/example_test.go
src/reflect/type.go
src/reflect/value.go