fix marshaljson not being called
This commit is contained in:
parent
2d634d863d
commit
675c42cfd5
|
@ -86,7 +86,7 @@ func ToCanFrame(p Packet) (id uint32, data []byte, err error) {
|
||||||
// internal structure for partially decoding json object.
|
// internal structure for partially decoding json object.
|
||||||
// includes
|
// includes
|
||||||
type RawJsonEvent struct {
|
type RawJsonEvent struct {
|
||||||
Timestamp int64 `json:"ts" db:"ts"`
|
Timestamp int64 `json:"ts" db:"ts"`
|
||||||
Id uint32 `json:"id"`
|
Id uint32 `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Data json.RawMessage `json:"data"`
|
Data json.RawMessage `json:"data"`
|
||||||
|
@ -99,7 +99,7 @@ type BusEvent struct {
|
||||||
Data Packet `json:"data"`
|
Data Packet `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *BusEvent) MarshalJSON() (b []byte, err error) {
|
func (e BusEvent) MarshalJSON() (b []byte, err error) {
|
||||||
// create the underlying raw event
|
// create the underlying raw event
|
||||||
j := &RawJsonEvent{
|
j := &RawJsonEvent{
|
||||||
Timestamp: e.Timestamp.UnixMilli(),
|
Timestamp: e.Timestamp.UnixMilli(),
|
||||||
|
|
Loading…
Reference in a new issue