Missing quotes make tile38 output invalid json
This commit is contained in:
parent
cc3667e3ed
commit
a44c3a6d67
@ -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")
|
jstime := time.Now().Format("2006-01-02T15:04:05.999999999Z07:00")
|
||||||
jshookName := jsonString(hookName)
|
jshookName := jsonString(hookName)
|
||||||
if strings.HasPrefix(res, "{") {
|
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)}
|
msgs := [][]byte{[]byte(res)}
|
||||||
switch detect {
|
switch detect {
|
||||||
case "enter":
|
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":
|
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
|
return msgs
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user