Source File
method_call.go
Belonging Package
github.com/goccy/go-json/internal/errors
package errorsimportvar (// ErrNonSingularValue and ErrUnsupportedMutation are the errors of a MarshalJSONTo or UnmarshalJSONFrom method// which the root package calls, which wrote or read other than one value, or which declined after it wrote or// read, as encoding/json/v2 reports them.ErrNonSingularValue = errors.New("must read or write exactly one value")ErrUnsupportedMutation = errors.New("unsupported calls must not read or write any tokens"))// MethodCallResult returns the error of a call of MarshalJSONTo or UnmarshalJSONFrom with an encoder or a decoder of// its own, which returned err, after which the stack of the encoder or the decoder is at the depth with n values at// its top level, and whether the method declined: it returned errors.ErrUnsupported and wrote or read nothing.func ( error, int, int64) (bool, error) {switch {case == nil && ( != 0 || != 1):return false, ErrNonSingularValuecase != nil && errors.Is(, errors.ErrUnsupported):if == 0 && == 0 {return true, nil}return false, ErrUnsupportedMutation}return false,}
![]() |
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. |