Questions about the Go "reflect" package that implements run-time reflection, allowing a program to manipulate objects with arbitrary types.
Questions Using Go programming language reflect package
Package reflect implements run-time reflection, allowing a program to
manipulate objects with arbitrary types. The typical use is to take a value
with static type interface{}
and extract its dynamic type information by
calling TypeOf
, which returns a Type
.
A call to ValueOf
returns a Value representing the run-time data.
Zero
takes a Type
and returns a Value
representing a zero value
for that type.
See "The Laws of Reflection" for an introduction to reflection in Go: https://golang.org/doc/articles/laws_of_reflection.html