remove sonic which only works on AMD64

Former-commit-id: 5073957b4706b68896006ee0f7bc30e49ff72c3b
This commit is contained in:
Eric Coissac
2024-06-24 14:53:18 +02:00
parent c1f03cb1f6
commit 1835cb2cf3
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import (
// TODO: The version number is extracted from git. This induces that the version // TODO: The version number is extracted from git. This induces that the version
// corresponds to the last commit, and not the one when the file will be // corresponds to the last commit, and not the one when the file will be
// commited // commited
var _Commit = "c94e79b" var _Commit = "ab9b472"
var _Version = "Release 4.2.0" var _Version = "Release 4.2.0"
// Version returns the version of the obitools package. // Version returns the version of the obitools package.

View File

@ -8,7 +8,7 @@ import (
"reflect" "reflect"
"sync" "sync"
"github.com/bytedance/sonic" "github.com/goccy/go-json"
"github.com/barkimedes/go-deepcopy" "github.com/barkimedes/go-deepcopy"
) )
@ -369,7 +369,8 @@ func AtomicCounter(initial ...int) func() int {
// It takes a bytes.Buffer as a buffer and an interface{} as i. // It takes a bytes.Buffer as a buffer and an interface{} as i.
// Returns an error. // Returns an error.
func JsonMarshalByteBuffer(buffer *bytes.Buffer, i interface{}) error { func JsonMarshalByteBuffer(buffer *bytes.Buffer, i interface{}) error {
encoder := sonic.ConfigDefault.NewEncoder(buffer) encoder := json.NewEncoder(buffer)
encoder.SetEscapeHTML(false)
err := encoder.Encode(i) err := encoder.Encode(i)
b := buffer.Bytes() b := buffer.Bytes()
b = bytes.TrimRight(b, "\n") b = bytes.TrimRight(b, "\n")