Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
msgpack
✓ gopkg.in/vmihailenco/msgpack.v2
Marshal and unmarshal a struct with msgpack.
package main
import (
"fmt"
"gopkg.in/vmihailenco/msgpack.v2"
)
func main() {
type Item struct {
Foo string
}
b, err := msgpack.Marshal(&Item{Foo: "bar"})
if err != nil {
panic(err)
}
var item Item
err = msgpack.Unmarshal(b, &item)
if err != nil {
panic(err)
}
fmt.Println(item.Foo)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
2.9.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.