From afa15461dedc16a4a2e38b28a1b85b7cd0f96236 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Mon, 23 May 2016 13:40:08 -0700 Subject: [PATCH] fixed json syntax error --- controller/fence.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/fence.go b/controller/fence.go index d12ba5ec..d9be0f52 100644 --- a/controller/fence.go +++ b/controller/fence.go @@ -117,13 +117,13 @@ func FenceMatch(hookName string, sw *scanWriter, fence *liveFenceSwitches, detai copy(resb, res) sw.wr.Reset() res = string(resb) + if strings.HasPrefix(res, ",") { + res = res[1:] + } if sw.output == outputIDs { res = `{"id":` + res + `}` } sw.mu.Unlock() - if strings.HasPrefix(res, ",") { - res = res[1:] - } jskey := jsonString(details.key)