File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 83
83
// - string: The "string" option specifies that [StringifyNumbers]
84
84
// be set when marshaling or unmarshaling a struct field value.
85
85
// This causes numeric types to be encoded as a JSON number
86
- // within a JSON string, and to be decoded from either a JSON number or
87
- // a JSON string containing a JSON number .
86
+ // within a JSON string, and to be decoded from a JSON string
87
+ // containing the JSON number without any surrounding whitespace .
88
88
// This extra level of encoding is often necessary since
89
89
// many JSON parsers cannot precisely represent 64-bit integers.
90
90
//
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ func CanonicalizeRawInts(v bool) Options {
117
117
}
118
118
119
119
// CanonicalizeRawFloats specifies that when encoding a raw JSON
120
- // floating-pointer number (i.e., a number with a fraction or exponent) in a
120
+ // floating-point number (i.e., a number with a fraction or exponent) in a
121
121
// [Token] or [Value], the number is canonicalized
122
122
// according to RFC 8785, section 3.2.2.3. As a special case,
123
123
// the number -0 is canonicalized as 0.
Original file line number Diff line number Diff line change @@ -105,9 +105,8 @@ func DefaultOptionsV2() Options {
105
105
106
106
// StringifyNumbers specifies that numeric Go types should be marshaled
107
107
// as a JSON string containing the equivalent JSON number value.
108
- // When unmarshaling, numeric Go types can be parsed from either
109
- // a JSON number or a JSON string containing the JSON number
110
- // without any surrounding whitespace.
108
+ // When unmarshaling, numeric Go types are parsed from a JSON string
109
+ // containing the JSON number without any surrounding whitespace.
111
110
//
112
111
// According to RFC 8259, section 6, a JSON implementation may choose to
113
112
// limit the representation of a JSON number to an IEEE 754 binary64 value.
Original file line number Diff line number Diff line change 26
26
// options control this behavior difference. To explicitly specify a Go struct
27
27
// field to use a particular name matching scheme, either the `nocase`
28
28
// or the `strictcase` field option can be specified.
29
+ // Field-specified options take precedence over caller-specified options.
29
30
//
30
31
// - In v1, when marshaling a Go struct, a field marked as `omitempty`
31
32
// is omitted if the field value is an "empty" Go value, which is defined as
47
48
// It does recursively take effect on Go numbers within a composite Go type.
48
49
// The [StringifyWithLegacySemantics] option controls this behavior difference.
49
50
//
50
- // - In v1, a nil Go slice or Go map are marshaled as a JSON null.
51
+ // - In v1, a nil Go slice or Go map is marshaled as a JSON null.
51
52
// In contrast, v2 marshals a nil Go slice or Go map as
52
53
// an empty JSON array or JSON object, respectively.
53
54
// The [jsonv2.FormatNilSliceAsNull] and [jsonv2.FormatNilMapAsNull] options
You can’t perform that action at this time.
0 commit comments