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
✓ github.com/vmihailenco/msgpack/v4
Marshal and unmarshal a struct using msgpack.
package main
import (
"fmt"
"github.com/vmihailenco/msgpack/v4"
)
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
4.3.13latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.