From 1835cb2cf335f3072949c13a0c1118021ec193ac Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Mon, 24 Jun 2024 14:53:18 +0200 Subject: [PATCH] remove sonic which only works on AMD64 Former-commit-id: 5073957b4706b68896006ee0f7bc30e49ff72c3b --- pkg/obioptions/version.go | 2 +- pkg/obiutils/goutils.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/obioptions/version.go b/pkg/obioptions/version.go index b04e191..5124a22 100644 --- a/pkg/obioptions/version.go +++ b/pkg/obioptions/version.go @@ -7,7 +7,7 @@ import ( // 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 // commited -var _Commit = "c94e79b" +var _Commit = "ab9b472" var _Version = "Release 4.2.0" // Version returns the version of the obitools package. diff --git a/pkg/obiutils/goutils.go b/pkg/obiutils/goutils.go index 01aade5..0dbc8fd 100644 --- a/pkg/obiutils/goutils.go +++ b/pkg/obiutils/goutils.go @@ -8,7 +8,7 @@ import ( "reflect" "sync" - "github.com/bytedance/sonic" + "github.com/goccy/go-json" "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. // Returns an 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) b := buffer.Bytes() b = bytes.TrimRight(b, "\n")