method
Values.MarshalJSON
Encode the field map as a JSON object.
Example
encoded, err := values.MarshalJSON()Returns
The JSON object.
([]byte, error)How it works
A nil map encodes as null. Calling it directly skips the extra validation pass encoding/json performs on a marshaler's output.
Full signature
func (values Values) MarshalJSON() (
[]byte,
error,
)Related types
ValuesA map of field names to typed values.