Lines Matching refs:json
5 // Represents JSON data structure using native Go types: booleans, floats,
8 package json
24 // Unmarshal parses the JSON-encoded data and stores the result
31 // To unmarshal JSON into a pointer, Unmarshal first handles the case of
32 // the JSON being the JSON literal null. In that case, Unmarshal sets
33 // the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into
37 // To unmarshal JSON into a struct, Unmarshal matches incoming object
41 // To unmarshal JSON into an interface value,
44 // bool, for JSON booleans
45 // float64, for JSON numbers
46 // string, for JSON strings
47 // []interface{}, for JSON arrays
48 // map[string]interface{}, for JSON objects
49 // nil for JSON null
51 // To unmarshal a JSON array into a slice, Unmarshal resets the slice to nil
54 // To unmarshal a JSON object into a map, Unmarshal replaces the map
58 // If a JSON value is not appropriate for a given target type,
59 // or if a JSON number overflows the target type, Unmarshal
64 // The JSON null value unmarshals into an interface, map, pointer, or slice
65 // by setting that Go value to nil. Because null is often used in JSON to mean
66 // ``not present,'' unmarshaling a JSON null into any other Go type has no effect
77 // before discovering a JSON syntax error.
89 // that can unmarshal a JSON description of themselves.
91 // a JSON value. UnmarshalJSON must copy the JSON data
97 // An UnmarshalTypeError describes a JSON value that was
100 Value string // description of JSON value - "bool", "array", "number -5"
106 return "json: cannot unmarshal " + e.Value + " into Go value of type " + e.Type.String()
109 // An UnmarshalFieldError describes a JSON object key that
119 return "json: cannot unmarshal object key " + strconv.Quote(e.Key) + " into unexported field " + e.Field.Name + " of type " + e.Type.String()
130 return "json: Unmarshal(nil)"
134 return "json: Unmarshal(non-pointer " + e.Type.String() + ")"
136 return "json: Unmarshal(nil " + e.Type.String() + ")"
161 // A Number represents a JSON number literal.
177 // decodeState represents the state while decoding a JSON value.
188 // there is a bug in the JSON decoder or something is editing
190 var errPhase = errors.New("JSON decoder out of sync - data changing underfoot?")
212 // next cuts off and returns the next full JSON value in d.data[d.off:].
255 // value decodes a JSON value from d.data[d.off:] into the value.
610 d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", subv.Type()))
673 d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
688 d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
697 d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
723 d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
741 d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
774 d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
787 d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type()))
973 // unquote converts a quoted JSON string literal s into an actual string t.