Reflection¶
📕 Articles¶
- The Laws of Reflection
- Reflections in Go - Go101
- Reflection - notes.shichao.io
- Reflection in Go
- Go Reflection Codex
- How to access unexported struct fields?
- Learning to Use Go Reflection
- Learning to Use Go Reflection — Part 2
- How do you create a new instance of a struct from its type at run time in Go?
- [Is there a way to create an instance of a struct from a string?](https://stackoverflow.com/questions/23030884/is-there-a-way-to-create-an-instance-of-a-struct-from-a-string/34722791#34722791
- Using reflect, how do you set the value of a struct field?
- reflect.Addr() Function in Golang with Examples
- Manipulating Private Fields in Go
- How to get the reflect.Type of an interface?
Libraries¶
- oleiade/reflections - Golang high level abstractions over reflect library
- tkrajina/go-reflector - Go reflection simplified
- goccy/go-reflect - Zero-allocation reflection library for Go
- Ompluscator/dynamic-struct - Golang package for editing struct’s fields during runtime and mapping structs to other structs
- xiaoxin01/typeregistry - create type dynamically in Golang
- AlexsJones/go-type-registry - Create a struct from a string
- modern-go/reflect2 - reflect api without runtime reflect.Value cost
- fengyoulin/inspect - Find a type by name in Golang.
- mitchellh/mapstructure - Go library for decoding generic map values into native Go structures and vice versa.
Samples¶
- a8m/reflect-examples - Bunch of examples for dealing with the reflect package
- call_method_with_reflection
- Golang Reflection Example