Source File
raw.go
Belonging Package
github.com/mailru/easyjson
package easyjsonimport ()// RawMessage is a raw piece of JSON (number, string, bool, object, array or// null) that is extracted without parsing and output as is during marshaling.type RawMessage []byte// MarshalEasyJSON does JSON marshaling using easyjson interface.func ( *RawMessage) ( *jwriter.Writer) {if len(*) == 0 {.RawString("null")} else {.Raw(*, nil)}}// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.func ( *RawMessage) ( *jlexer.Lexer) {* = RawMessage(.Raw())}// UnmarshalJSON implements encoding/json.Unmarshaler interface.func ( *RawMessage) ( []byte) error {* =return nil}var nullBytes = []byte("null")// MarshalJSON implements encoding/json.Marshaler interface.func ( RawMessage) () ([]byte, error) {if len() == 0 {return nullBytes, nil}return , nil}// IsDefined is required for integration with omitempty easyjson logic.func ( *RawMessage) () bool {return len(*) > 0}
![]() |
The pages are generated with Golds v0.8.2. (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. |