Apply compat patch

This commit is contained in:
yusing
2026-02-28 19:37:38 +08:00
parent 5f48f141ca
commit 27dc13a9a8
66 changed files with 418 additions and 739 deletions

View File

@@ -1,6 +1,7 @@
package serialization
import (
"encoding/json"
"errors"
"fmt"
"io"
@@ -12,7 +13,6 @@ import (
"time"
"unsafe"
"github.com/bytedance/sonic"
"github.com/go-playground/validator/v10"
"github.com/goccy/go-yaml"
"github.com/puzpuzpuz/xsync/v4"
@@ -34,8 +34,8 @@ func ToSerializedObject[VT any](m map[string]VT) SerializedObject {
}
func init() {
strutils.SetJSONMarshaler(sonic.Marshal)
strutils.SetJSONUnmarshaler(sonic.Unmarshal)
strutils.SetJSONMarshaler(json.Marshal)
strutils.SetJSONUnmarshaler(json.Unmarshal)
strutils.SetYAMLMarshaler(yaml.Marshal)
strutils.SetYAMLUnmarshaler(yaml.Unmarshal)
}