mirror of
https://github.com/golang/go.git
synced 2025-12-07 13:50:04 +00:00
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: 8768ef71b9
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>
345 B
345 B
[reflect.Type] includes new methods that return iterators for a type's fields, methods, inputs and outputs. Similarly, [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]) and its type information ([reflect.StructField] or [reflect.Method]).