-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal
Milestone
Description
Proposal Details
This is a sub-issue of the "encoding/json/v2" proposal (#71497).
I propose adding the following to the encoding/json/jsontext (Switch statement generates longer assembly).
func (k Kind) IsValid() bool {
return k == 'n' || k == 'f' || k == 't' || k == '"' || k == '0' || k == '{' || k == '}' || k == '[' || k == ']'
}Rationale
This provides a reliable way to determine whether Kind is valid, because as I learned, this is incorrect.
func (k Kind) IsValid() bool {
return k != 0
}earthboundkid and IwailerI
Metadata
Metadata
Assignees
Labels
LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal
Type
Projects
Status
Done