Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FloatPrecision = -1
FloatPrecision is the precision used when formatting float values.
Functions ¶
func EncodeFormValues ¶
EncodeFormValues encodes a struct into URL form values by extracting tagged fields.
The function accepts a struct and extracts fields with the "form" tag. It then converts non-empty string, non-zero integer, true boolean, and non-zero float fields into URL form values. It also handles pointer values for these primitive types.
The "omitempty" tag can be used to skip fields that have the "omitempty" tag and are empty.
Parameters:
- data: The input struct to be encoded.
Returns:
- url.Values: A map of field names to their string values in URL form.
- error: An error if the input data is not a struct or if encoding fails.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.