Home | History | Annotate | Download | only in json

Lines Matching defs:Marshal

7 // in the documentation for the Marshal and Unmarshal functions.
28 // Marshal returns the JSON encoding of v.
30 // Marshal traverses the value v recursively.
32 // and is not a nil pointer, Marshal calls its MarshalJSON method
37 // Otherwise, Marshal uses the following type-dependent default encodings:
100 // deciding which field to marshal or unmarshal. If there are
126 // Attempting to encode such a value causes Marshal to return
129 // JSON cannot represent cyclic data structures and Marshal does not
130 // handle them. Passing cyclic structures to Marshal will result in
133 func Marshal(v interface{}) ([]byte, error) {
135 err := e.marshal(v)
142 // MarshalIndent is like Marshal but applies Indent to format the output.
144 b, err := Marshal(v)
192 // can marshal themselves into valid JSON.
197 // An UnsupportedTypeError is returned by Marshal when attempting
216 // Before Go 1.2, an InvalidUTF8Error was returned by Marshal when
218 // As of Go 1.2, Marshal instead coerces the string to valid UTF-8 by
258 func (e *encodeState) marshal(v interface{}) (err error) {
540 sb, err := Marshal(v.String())