Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode decodes JSON data from the given io.Reader into the provided interface{}. It uses the sonic decoder to decode the data and returns an error if any error occurs during the decoding process.
Parameters: - r: The io.Reader to read the JSON data from. - v: The interface{} to decode the JSON data into.
Returns: - error: An error if any error occurs during the decoding process, otherwise nil.
func Encode ¶
Encode encodes the provided value into JSON format and writes it to the provided io.Writer.
The function returns an error if there was an issue encoding the value.
func MarshalIndent ¶
MarshalIndent encodes the provided value into JSON format with indentation. It returns the JSON encoded data and an error if any error occurs during the encoding process.
Parameters: - v: The value to be encoded into JSON format. - prefix: The prefix to be added at the beginning of each line of indented JSON data. - indent: The string used for indentation.
Returns: - []byte: The JSON encoded data. - error: An error if any error occurs during the encoding process, otherwise nil.
Types ¶
This section is empty.