Source File
number_error_v2.go
Belonging Package
github.com/goccy/go-json/internal/encoder
//go:build go1.27 && goexperiment.jsonv2package encoderimport ()// invalidNumberError is the error of a json.Number which is not a JSON number, as encoding/json of Go 1.27// reports it: an error of its method MarshalJSONTo, which shows the number with its quotes if it is quoted.func invalidNumberError( json.Number, bool) error {:= string()if {= `"` + + `"`}return errors.ErrMarshaler(reflect.TypeFor[*json.Number](),fmt.Errorf("cannot parse %q as JSON number: %w", , strconv.ErrSyntax), "MarshalJSONTo")}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |