Пример #1
0
func (m ubjsonRawMessage) MarshalJSON() ([]byte, error) {
	// TODO(imax): translate UBJSON into JSON directly, without full deserialization.
	var v interface{}
	if err := ubjson.Unmarshal(m, &v); err != nil {
		return nil, errors.Annotatef(err, "UBJSON unmarshaling")
	}
	b, err := json.Marshal(v)
	return b, errors.Trace(err)
}
Пример #2
0
func (m ubjsonRawMessage) UnmarshalInto(v interface{}) error {
	return ubjson.Unmarshal(m, v)
}