mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-03-23 03:21:50 +00:00
⚡️ 使用 json-iterator 替换 encoding/json 进行一些序列化/反序列化操作
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/naiba/nezha/pkg/utils"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ func TestServerMarshal(t *testing.T) {
|
||||
}
|
||||
serverStr := string(server.Marshal())
|
||||
var serverRestore Server
|
||||
assert.Nil(t, json.Unmarshal([]byte(serverStr), &serverRestore))
|
||||
assert.Nil(t, utils.Json.Unmarshal([]byte(serverStr), &serverRestore))
|
||||
assert.Equal(t, server, serverRestore)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user