Documentation
¶
Overview ¶
Example (Rawbyte_json) ¶
var obj struct { Name string `json:"name"` Params RawBytes `json:"params"` } body := `{"name":"abc","params":"eeeddd"}` err := json.Unmarshal([]byte(body), &obj) if err != nil { fmt.Println(err) return } fmt.Println(obj, string(obj.Params))
Output: {abc [34 101 101 101 100 100 100 34]} "eeeddd"
Index ¶
- type RawBytes
- func (bs RawBytes) Bytes() []byte
- func (bs *RawBytes) GobDecode(data []byte) error
- func (bs RawBytes) GobEncode() ([]byte, error)
- func (bs RawBytes) MarshalBinary() ([]byte, error)
- func (bs RawBytes) MarshalJSON() ([]byte, error)
- func (bs RawBytes) MarshalText() ([]byte, error)
- func (bs *RawBytes) UnmarshalBinary(data []byte) error
- func (bs *RawBytes) UnmarshalJSON(data []byte) error
- func (bs *RawBytes) UnmarshalText(data []byte) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RawBytes ¶
type RawBytes []byte
RawBytes .
func (RawBytes) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (RawBytes) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (RawBytes) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface. The time is formatted in RFC 3339 format, with sub-second precision added if present.
func (*RawBytes) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*RawBytes) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.