convert remaining uses of encoding/json to jsoniter

This commit is contained in:
bn4t 2020-10-09 16:26:41 +02:00
parent 1f2d7d61e2
commit 8e922fb3c6
7 changed files with 7 additions and 9 deletions

View file

@ -15,7 +15,7 @@
package routing package routing
import ( import (
"encoding/json" json "github.com/json-iterator/go"
"fmt" "fmt"
"net/http" "net/http"
"strconv" "strconv"

View file

@ -16,7 +16,7 @@ package routing
import ( import (
"context" "context"
"encoding/json" json "github.com/json-iterator/go"
"net/http" "net/http"
"time" "time"

View file

@ -16,7 +16,6 @@ package routing
import ( import (
"context" "context"
stdjson "encoding/json"
"fmt" "fmt"
json "github.com/json-iterator/go" json "github.com/json-iterator/go"
"net/http" "net/http"
@ -56,7 +55,7 @@ func Send(
} }
var txnEvents struct { var txnEvents struct {
PDUs []stdjson.RawMessage `json:"pdus"` PDUs []json.RawMessage `json:"pdus"`
EDUs []gomatrixserverlib.EDU `json:"edus"` EDUs []gomatrixserverlib.EDU `json:"edus"`
} }

View file

@ -2,7 +2,7 @@ package routing
import ( import (
"context" "context"
"encoding/json" json "github.com/json-iterator/go"
"fmt" "fmt"
"reflect" "reflect"
"testing" "testing"

View file

@ -16,7 +16,6 @@ package consumers
import ( import (
"context" "context"
stdjson "encoding/json"
"fmt" "fmt"
json "github.com/json-iterator/go" json "github.com/json-iterator/go"
@ -121,7 +120,7 @@ func (t *OutputEDUConsumer) onSendToDeviceEvent(msg *sarama.ConsumerMessage) err
Sender: ote.Sender, Sender: ote.Sender,
Type: ote.Type, Type: ote.Type,
MessageID: util.RandomString(32), MessageID: util.RandomString(32),
Messages: map[string]map[string]stdjson.RawMessage{ Messages: map[string]map[string]json.RawMessage{
ote.UserID: { ote.UserID: {
ote.DeviceID: ote.Content, ote.DeviceID: ote.Content,
}, },

View file

@ -16,7 +16,7 @@ package queue
import ( import (
"context" "context"
"encoding/json" json "github.com/json-iterator/go"
"fmt" "fmt"
"sync" "sync"
"time" "time"

View file

@ -3,7 +3,7 @@ package storage_test
import ( import (
"context" "context"
"crypto/ed25519" "crypto/ed25519"
"encoding/json" json "github.com/json-iterator/go"
"fmt" "fmt"
"os" "os"
"testing" "testing"