encoding/json: please document that float +inf/-inf/nan will cause json.Marshal return error #59627
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (go version)?
go version go1.19.2 darwin/amd64
Does this issue reproduce with the latest release?
It does with go playground
What did you do?
Same as #3480
https://play.golang.org/p/K4xwS7iy4MP
What did you expect to see?
Document that float +inf/-inf/nan will cause json.Marshal return error or Not throwing serialization errors on basic numeric data types with valid state.
What did you see instead?
No document of this kind of thing and return json: unsupported value: NaN
Should golang standard library document possible/common error type of a package or a function like windows api document(https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-deletefilew) or linux man (https://linux.die.net/man/3/mmap)?
Code with standard library sometime looks like try and fix again and again without document of possible/common error type.
reference:
The text was updated successfully, but these errors were encountered: