proposal: encoding/json: add Number.Float32 and Number.Int32 methods #73636
Labels
LibraryProposal
Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool
Proposal
Milestone
Proposal Details
Goal
This proposal suggests adding Float32() and Int32() methods to the encoding/json.Number type to simplify access to 32-bit numeric values. These additions are fully backward-compatible and improve usability when decoding JSON into smaller numeric types.
n := json.Number("42")
i32 := n.Float32()
The text was updated successfully, but these errors were encountered: