Documentation
¶
Overview ¶
Package trans implements the functions, types, and interfaces for the module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PointerOrZero ¶ added in v0.3.0
PointerOrZero attempts to convert the input value to type *T. Returns a pointer to v if v is of type T, returns v directly if it's already *T, otherwise returns a pointer to a zero value of T. Parameters:
v: The value to be converted, of any type.
Returns:
A pointer of type *T pointing to v or a newly allocated zero value.
func ValueOrZero ¶ added in v0.3.0
ValueOrZero attempts to convert the input value to the specified generic type. Returns the value if: - input is a non-nil pointer to the target type (*T) - input is a direct value of the target type (T) Otherwise returns the zero value of type T. Parameters:
v: any type input value that needs conversion
Returns:
T value of the target type, or zero value when conversion fails
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package reflection implements the functions, types, and interfaces for the module.
|
Package reflection implements the functions, types, and interfaces for the module. |
Click to show internal directories.
Click to hide internal directories.