Lines Matching full:marshal
7 // in the documentation for the Marshal and Unmarshal functions.
30 // Marshal returns the JSON encoding of v.
32 // Marshal traverses the value v recursively.
34 // and is not a nil pointer, Marshal calls its MarshalJSON method
36 // value implements encoding.TextMarshaler instead, Marshal calls
42 // Otherwise, Marshal uses the following type-dependent default encodings:
120 // deciding which field to marshal or unmarshal. If there are
152 // Attempting to encode such a value causes Marshal to return
155 // JSON cannot represent cyclic data structures and Marshal does not
156 // handle them. Passing cyclic structures to Marshal will result in
159 func Marshal(v interface{}) ([]byte, error) {
161 err := e.marshal(v, encOpts{escapeHTML: true})
168 // MarshalIndent is like Marshal but applies Indent to format the output.
172 b, err := Marshal(v)
220 // can marshal themselves into valid JSON.
225 // An UnsupportedTypeError is returned by Marshal when attempting
244 // Before Go 1.2, an InvalidUTF8Error was returned by Marshal when
246 // As of Go 1.2, Marshal instead coerces the string to valid UTF-8 by
286 func (e *encodeState) marshal(v interface{}, opts encOpts) (err error) {
596 sb, err := Marshal(v.String())