Go · Function
json.Marshal
json.Marshal converts a Go value into JSON bytes. It returns the encoded bytes and an error.
Last updated
Syntax
func Marshal(v any) ([]byte, error)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
MarshalIndentMarshalerUnmarshalerEncoderUnsupportedTypeErrorUnsupportedValueError