From a4046f9a4b1d4d76cbae4eccad7634e693f3285b Mon Sep 17 00:00:00 2001 From: a <a@tuxpa.in> Date: Thu, 13 Jul 2023 22:09:29 -0500 Subject: [PATCH] remove jz --- pkg/codec/json.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/codec/json.go b/pkg/codec/json.go index c4988d1..646fece 100644 --- a/pkg/codec/json.go +++ b/pkg/codec/json.go @@ -6,11 +6,9 @@ import ( "github.com/go-faster/jx" - "gfx.cafe/open/jrpc/contrib/codecs/websocket/wsjson" + gojson "github.com/goccy/go-json" ) -var jzon = wsjson.JZON - var Null = json.RawMessage("null") func NewNull() json.RawMessage { @@ -103,7 +101,7 @@ func (msg *Message) ErrorResponse(err error) *Message { } func (msg *Message) response(result any) *Message { // do a funny marshaling - enc, err := jzon.Marshal(result) + enc, err := gojson.Marshal(result) if err != nil { return msg.ErrorResponse(err) } @@ -177,7 +175,7 @@ func IsBatchMessage(raw json.RawMessage) bool { func ParseMessage(raw json.RawMessage) ([]*Message, bool) { if !IsBatchMessage(raw) { msgs := []*Message{{}} - jzon.Unmarshal(raw, &msgs[0]) + gojson.Unmarshal(raw, &msgs[0]) return msgs, false } // TODO: -- GitLab