Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PatchValue ¶
PatchValue enables assignment to an unexported struct field by clearing the internal read-only flags.
It takes a reflect.Value and returns the same Value after patching. This allows the caller to call Set on a Value that originally pointed to an unexported field.
WARNING:
- This function relies on unsafe access to reflect.Value's internal 'flag' field.
- It is highly version-dependent and may break in future Go releases.
- Using this in production code is unsafe and may cause undefined behavior.
- Only use this in controlled internal tools where performance or testing requires it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.