Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(value reflect.Value, field rivertags.Field) reflect.Value
Get returns the nested field of value corresponding to index. Get panics if not given a struct.
It is similar to reflect/Value.FieldByIndex but can handle traversing through nil pointers. If Get traverses through a nil pointer, a non-settable zero value for the final field is returned.
func GetOrAlloc ¶
func GetOrAlloc(value reflect.Value, field rivertags.Field) reflect.Value
GetOrAlloc returns the nested field of value corresponding to index. GetOrAlloc panics if not given a struct.
func GetOrAllocIndex ¶
func GetOrAllocIndex(value reflect.Value, index []int) reflect.Value
GetOrAllocIndex returns the nested field of value corresponding to index. GetOrAllocIndex panics if not given a struct.
It is similar to reflect/Value.FieldByIndex but can handle traversing through nil pointers. If allocate is true, GetOrAllocIndex allocates any intermediate nil pointers while traversing the struct.
Types ¶
This section is empty.