diff options
Diffstat (limited to 'modules/eventsource/event.go')
-rw-r--r-- | modules/eventsource/event.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/eventsource/event.go b/modules/eventsource/event.go index fd418c6f07..a3407a94d2 100644 --- a/modules/eventsource/event.go +++ b/modules/eventsource/event.go @@ -6,11 +6,12 @@ package eventsource import ( "bytes" - "encoding/json" "fmt" "io" "strings" "time" + + jsoniter "github.com/json-iterator/go" ) func wrapNewlines(w io.Writer, prefix []byte, value []byte) (sum int64, err error) { @@ -79,6 +80,7 @@ func (e *Event) WriteTo(w io.Writer) (int64, error) { data = []byte(v) default: var err error + json := jsoniter.ConfigCompatibleWithStandardLibrary data, err = json.Marshal(e.Data) if err != nil { return sum, err |