在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
go使用msgpack // test project main.go package main import ( "fmt" "github.com/vmihailenco/msgpack" ) type ( Player struct { Id int Name string } ) func main() { var s [3]Player = [3]Player{ Player{1, "李白"}, Player{2, "赵四"}, Player{3, "小白"}} fmt.Println(s) b, _ := msgpack.Marshal(s) //序列 fmt.Println(b) var out []Player _ = msgpack.Unmarshal(b, &out) //还原 fmt.Println(out) }
|
请发表评论