reflections
reflections copied to clipboard
High level abstractions over the Go reflect library
Is possible to get embeeded struct field for example struct A { Person Person } struct Person { fields.... } I need to get person fields without use direct struct
when i use go version 1.19, it will throw the panic: panic: reflect.Value.Interface: cannot return value obtained from unexported field or method i change the " reflect.Interface{}" to "reflect", its...
Hello, Thanks for `reflections`! We're using this project and had it pinned in `Gopkg.lock` as follows: ``` [[projects]] digest = "1:c17f50b4ccbba568a6fc10b06a24bb8ac99077470fd48a905759f9914d631dd7" name = "github.com/oleiade/reflections" packages = ["."] pruneopts = "NUT"...
I get the following trace: ` --- FAIL: TestGetSetAttr (0.00s) panic: reflect: call of reflect.Value.Elem on struct Value [recovered] panic: reflect: call of reflect.Value.Elem on struct Value goroutine 38 [running]:...
Hi, thanks for making this awesome library. Currently, all the `Get...` functions return a tuple `(value, err)` like the examples the docs show: ``` value, err := reflections.GetField(s, fieldName) ```...
Hi, can we add a `GetFieldNameByTagValueDeep` function equivalent for `GetFieldNameByTagValue` like we have `TagsDeep` for `Tags`? I made a PR for it here: https://github.com/oleiade/reflections/pull/25
Add "Deep" equivalent for GetFieldNameByTagValue closes #26