[go] encoding/json/jsontext: add float32 support

0 views
Skip to first unread message

Joseph Tsai (Gerrit)

unread,
Apr 24, 2026, 5:56:32 PM (15 hours ago) Apr 24
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, golang...@luci-project-accounts.iam.gserviceaccount.com, Damien Neil, Michael Pratt, Johan Brandhorst-Satzkorn, Daniel Martí, Chris Hines, golang-co...@googlegroups.com

Joseph Tsai submitted the change

Unreviewed changes

2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Change information

Commit message:
encoding/json/jsontext: add float32 support

This adds the following API:
Float32
Token.Float32
AppendFloat

This provides helper functionality for formatting and parsing
JSON numbers encoded to only 32 bits of precision.

Note that the "json" package itself already sets the precedence
for using shorter representation for encoding float32.
The new API surfaces something that the "json" package
is already able to do.

Fixes #76430
Change-Id: I643e5a33afdadddeb706eceebf3e1e22bb58740a
Reviewed-by: Damien Neil <dn...@google.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
Reviewed-by: Michael Pratt <mpr...@google.com>
Files:
  • M src/encoding/json/jsontext/token.go
  • M src/encoding/json/jsontext/token_test.go
  • M src/encoding/json/jsontext/value.go
Change size: M
Delta: 3 files changed, 161 insertions(+), 59 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I643e5a33afdadddeb706eceebf3e1e22bb58740a
Gerrit-Change-Number: 741041
Gerrit-PatchSet: 4
Gerrit-Owner: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Daniel Martí <mv...@mvdan.cc>
Gerrit-Reviewer: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-CC: Chris Hines <chris....@gmail.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages