From e1207a8deb28da2b1c2e0d953cd3baa7875cec5b Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 4 Nov 2024 00:12:17 +0800 Subject: [PATCH] :arrow_up: Change encode map json lib --- pkg/main.go | 2 +- pkg/nex/encode.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/main.go b/pkg/main.go index 2599f62..37d8222 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -104,7 +104,7 @@ func main() { } // Post-boot actions - directory.ValidateServices() + go directory.ValidateServices() // Server go server.NewServer().Listen() diff --git a/pkg/nex/encode.go b/pkg/nex/encode.go index 249ba32..7f8ee44 100644 --- a/pkg/nex/encode.go +++ b/pkg/nex/encode.go @@ -1,14 +1,16 @@ package nex -import jsoniter "github.com/json-iterator/go" +import ( + "github.com/goccy/go-json" +) func EncodeMap(data any) []byte { - raw, _ := jsoniter.Marshal(data) + raw, _ := json.Marshal(data) return raw } func DecodeMap(raw []byte) map[string]any { var out map[string]any - _ = jsoniter.Unmarshal(raw, &out) + _ = json.Unmarshal(raw, &out) return out }