Skip to content

Commit

Permalink
Fix typo in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnet committed Jan 27, 2025
1 parent 3d76ae0 commit 9a5eb1b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
// - string: The "string" option specifies that [StringifyNumbers]
// be set when marshaling or unmarshaling a struct field value.
// This causes numeric types to be encoded as a JSON number
// within a JSON string, and to be decoded from either a JSON number or
// a JSON string containing a JSON number.
// within a JSON string, and to be decoded from a JSON string
// containing the JSON number without any surrounding whitespace.
// This extra level of encoding is often necessary since
// many JSON parsers cannot precisely represent 64-bit integers.
//
Expand Down
2 changes: 1 addition & 1 deletion jsontext/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func CanonicalizeRawInts(v bool) Options {
}

// CanonicalizeRawFloats specifies that when encoding a raw JSON
// floating-pointer number (i.e., a number with a fraction or exponent) in a
// floating-point number (i.e., a number with a fraction or exponent) in a
// [Token] or [Value], the number is canonicalized
// according to RFC 8785, section 3.2.2.3. As a special case,
// the number -0 is canonicalized as 0.
Expand Down
5 changes: 2 additions & 3 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ func DefaultOptionsV2() Options {

// StringifyNumbers specifies that numeric Go types should be marshaled
// as a JSON string containing the equivalent JSON number value.
// When unmarshaling, numeric Go types can be parsed from either
// a JSON number or a JSON string containing the JSON number
// without any surrounding whitespace.
// When unmarshaling, numeric Go types are parsed from a JSON string
// containing the JSON number without any surrounding whitespace.
//
// According to RFC 8259, section 6, a JSON implementation may choose to
// limit the representation of a JSON number to an IEEE 754 binary64 value.
Expand Down
3 changes: 2 additions & 1 deletion v1/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
// options control this behavior difference. To explicitly specify a Go struct
// field to use a particular name matching scheme, either the `nocase`
// or the `strictcase` field option can be specified.
// Field-specified options take precedence over caller-specified options.
//
// - In v1, when marshaling a Go struct, a field marked as `omitempty`
// is omitted if the field value is an "empty" Go value, which is defined as
Expand All @@ -47,7 +48,7 @@
// It does recursively take effect on Go numbers within a composite Go type.
// The [StringifyWithLegacySemantics] option controls this behavior difference.
//
// - In v1, a nil Go slice or Go map are marshaled as a JSON null.
// - In v1, a nil Go slice or Go map is marshaled as a JSON null.
// In contrast, v2 marshals a nil Go slice or Go map as
// an empty JSON array or JSON object, respectively.
// The [jsonv2.FormatNilSliceAsNull] and [jsonv2.FormatNilMapAsNull] options
Expand Down

0 comments on commit 9a5eb1b

Please sign in to comment.