From ab419f6917d5bf30dd6557902ee01b3c529c89f0 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Thu, 3 Oct 2013 00:34:00 +0000 Subject: [PATCH] better msg format --- go/r3-eventbroker_zmq/sockettoevent.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go/r3-eventbroker_zmq/sockettoevent.go b/go/r3-eventbroker_zmq/sockettoevent.go index 6664a97..94d8996 100644 --- a/go/r3-eventbroker_zmq/sockettoevent.go +++ b/go/r3-eventbroker_zmq/sockettoevent.go @@ -145,12 +145,12 @@ func MakeTimeTick(ps *pubsub.PubSub) { func FormatEventForSocket(event_interface interface{}) (data [][]byte, err error) { var msg []byte fmt.Printf("%T%+v\n", event_interface, event_interface) - etype := fmt.Sprintf("%T", event_interface)[5:] - msg, err = json.Marshal(map[string]interface{}{etype: event_interface}) + msg, err = json.Marshal(event_interface) if err != nil { return } - data = [][]byte{msg} + etype := []byte(fmt.Sprintf("%T", event_interface)[5:]) + data = [][]byte{etype, msg} return } -- 1.7.10.4