⬆️ Change encode map json lib
This commit is contained in:
parent
7e4d6bb33f
commit
e1207a8deb
@ -104,7 +104,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Post-boot actions
|
||||
directory.ValidateServices()
|
||||
go directory.ValidateServices()
|
||||
|
||||
// Server
|
||||
go server.NewServer().Listen()
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user