mirror of https://github.com/tidwall/tile38.git
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")
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue