From: Bernhard Tittelbach Date: Thu, 3 Oct 2013 00:34:00 +0000 (+0000) Subject: better msg format X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=ab419f6917d5bf30dd6557902ee01b3c529c89f0;p=svn42.git better msg format --- 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 }