use json unmarshal/marshal from jsoniter in hotpaths (#12269)

This commit is contained in:
Harshavardhana
2021-05-11 02:02:32 -07:00
committed by GitHub
parent 14849b9b2c
commit b81fada834
8 changed files with 16 additions and 4 deletions

View File

@@ -26,7 +26,6 @@ import (
"crypto"
"crypto/hmac"
"encoding/base64"
"encoding/json"
"fmt"
"strings"
"sync"
@@ -188,6 +187,7 @@ func (c *MapClaims) Map() map[string]interface{} {
// MarshalJSON marshals the MapClaims struct
func (c *MapClaims) MarshalJSON() ([]byte, error) {
var json = jsoniter.ConfigCompatibleWithStandardLibrary
return json.Marshal(c.MapClaims)
}