1 Star 0 Fork 0

wuzpdev/goworld

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
JsoniterMsgPacker.go 650 Bytes
Copy Edit Raw Blame History
seis authored 2017-09-25 16:06 . tested jsoniter
package netutil
// JsoniterMsgPacker packs and unpacks messages in JSON format
type JsoniterMsgPacker struct{}
// PackMsg packs message to bytes of JSON format
func (mp JsoniterMsgPacker) PackMsg(msg interface{}, buf []byte) ([]byte, error) {
return nil, nil
//buffer := bytes.NewBuffer(buf)
//jsonEncoder := jsoniter.NewEncoder(buffer)
//err := jsonEncoder.Encode(msg)
//if err != nil {
// return buf, err
//}
//return buffer.Bytes(), nil
}
// UnpackMsg unpacks bytes of JSON format to message
func (mp JsoniterMsgPacker) UnpackMsg(data []byte, msg interface{}) error {
//err := jsoniter.Unmarshal(data, msg)
//return err
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuzpdev/goworld.git
git@gitee.com:wuzpdev/goworld.git
wuzpdev
goworld
goworld
v0.1.2

Search

0d507c66 1850385 C8b1a773 1850385