summaryrefslogtreecommitdiffstats
path: root/modules/queue/helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/queue/helper.go')
-rw-r--r--modules/queue/helper.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/queue/helper.go b/modules/queue/helper.go
index 751e0cfadc..161c2fe8e7 100644
--- a/modules/queue/helper.go
+++ b/modules/queue/helper.go
@@ -5,8 +5,9 @@
package queue
import (
- "encoding/json"
"reflect"
+
+ jsoniter "github.com/json-iterator/go"
)
// Mappable represents an interface that can MapTo another interface
@@ -19,6 +20,7 @@ type Mappable interface {
// It will tolerate the cfg being passed as a []byte or string of a json representation of the
// exemplar or the correct type of the exemplar itself
func toConfig(exemplar, cfg interface{}) (interface{}, error) {
+ json := jsoniter.ConfigCompatibleWithStandardLibrary
// First of all check if we've got the same type as the exemplar - if so it's all fine.
if reflect.TypeOf(cfg).AssignableTo(reflect.TypeOf(exemplar)) {
@@ -66,6 +68,7 @@ func toConfig(exemplar, cfg interface{}) (interface{}, error) {
// unmarshalAs will attempt to unmarshal provided bytes as the provided exemplar
func unmarshalAs(bs []byte, exemplar interface{}) (data Data, err error) {
+ json := jsoniter.ConfigCompatibleWithStandardLibrary
if exemplar != nil {
t := reflect.TypeOf(exemplar)
n := reflect.New(t)