From a44c3a6d67913c57fb9281ab3424de9aa84bb9ef Mon Sep 17 00:00:00 2001 From: Fabian Aussems Date: Thu, 24 Mar 2016 16:18:18 +0100 Subject: [PATCH] Missing quotes make tile38 output invalid json --- controller/fence.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/fence.go b/controller/fence.go index 974c7a6c..080836bd 100644 --- a/controller/fence.go +++ b/controller/fence.go @@ -99,14 +99,14 @@ func (c *Controller) FenceMatch(hookName string, sw *scanWriter, fence *liveFenc jstime := time.Now().Format("2006-01-02T15:04:05.999999999Z07:00") jshookName := jsonString(hookName) if strings.HasPrefix(res, "{") { - res = `{"command":"` + details.command + `","detect":"` + detect + `","hook":` + jshookName + `,"time":"` + jstime + `,"key":` + jskey + `,` + res[1:] + res = `{"command":"` + details.command + `","detect":"` + detect + `","hook":` + jshookName + `,"time":"` + jstime + `","key":` + jskey + `,` + res[1:] } msgs := [][]byte{[]byte(res)} switch detect { case "enter": - msgs = append(msgs, []byte(`{"command":"`+details.command+`","detect":"inside","hook":`+jshookName+`,"time":"`+jstime+`,"key":`+jskey+`,`+res[1:])) + msgs = append(msgs, []byte(`{"command":"`+details.command+`","detect":"inside","hook":`+jshookName+`,"time":"`+jstime+`","key":`+jskey+`,`+res[1:])) case "exit", "cross": - msgs = append(msgs, []byte(`{"command":"`+details.command+`","detect":"outside","hook":`+jshookName+`,"time":"`+jstime+`,"key":`+jskey+`,`+res[1:])) + msgs = append(msgs, []byte(`{"command":"`+details.command+`","detect":"outside","hook":`+jshookName+`,"time":"`+jstime+`","key":`+jskey+`,`+res[1:])) } return msgs }