Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
contract.ReflectOperator
}
type DefaultTool ¶ added in v0.1.11
func NewTool ¶
func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool
func (*DefaultTool) FillNilPointers ¶ added in v0.1.11
func (d *DefaultTool) FillNilPointers(ctx context.Context, to, from any) error
FillNilPointers replaces nil pointer fields in the target struct with values from the source struct.
Key Principles: - Only nil pointers in to will be replaced by the corresponding values from from. - Deep copying prevents the structs from sharing underlying data references. - Non-nil fields remain untouched in to. - Unexported fields will be skipped. - Supports nested struct pointers with recursive handling. - Prevents panic for non-struct primitive types.
Supported Input Combinations: - to and from can be:
- An interface holding a struct directly.
- An interface holding a pointer to a struct.
- A pointer to a struct directly.
- A struct directly.
Click to show internal directories.
Click to hide internal directories.