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 }