Skip to content

Commit bbe7ee0

Browse files
authored
Fix typo in docs (#149)
1 parent 96631bc commit bbe7ee0

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
// - string: The "string" option specifies that [StringifyNumbers]
8484
// be set when marshaling or unmarshaling a struct field value.
8585
// 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.
8888
// This extra level of encoding is often necessary since
8989
// many JSON parsers cannot precisely represent 64-bit integers.
9090
//

jsontext/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func CanonicalizeRawInts(v bool) Options {
117117
}
118118

119119
// 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
121121
// [Token] or [Value], the number is canonicalized
122122
// according to RFC 8785, section 3.2.2.3. As a special case,
123123
// the number -0 is canonicalized as 0.

options.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ func DefaultOptionsV2() Options {
105105

106106
// StringifyNumbers specifies that numeric Go types should be marshaled
107107
// 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.
111110
//
112111
// According to RFC 8259, section 6, a JSON implementation may choose to
113112
// limit the representation of a JSON number to an IEEE 754 binary64 value.

v1/options.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
// options control this behavior difference. To explicitly specify a Go struct
2727
// field to use a particular name matching scheme, either the `nocase`
2828
// or the `strictcase` field option can be specified.
29+
// Field-specified options take precedence over caller-specified options.
2930
//
3031
// - In v1, when marshaling a Go struct, a field marked as `omitempty`
3132
// is omitted if the field value is an "empty" Go value, which is defined as
@@ -47,7 +48,7 @@
4748
// It does recursively take effect on Go numbers within a composite Go type.
4849
// The [StringifyWithLegacySemantics] option controls this behavior difference.
4950
//
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.
5152
// In contrast, v2 marshals a nil Go slice or Go map as
5253
// an empty JSON array or JSON object, respectively.
5354
// The [jsonv2.FormatNilSliceAsNull] and [jsonv2.FormatNilMapAsNull] options

0 commit comments

Comments
 (0)