Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

549 Commits

Repository files navigation

MessagePack encoding for Golang

Build StatusPkgGoDevDocumentationChat

❤️ Uptrace.dev - All-in-one tool to optimize performance and monitor errors & logs

Other projects you may like:

  • Bun - fast and simple SQL client for PostgreSQL, MySQL, and SQLite.
  • BunRouter - fast and flexible HTTP router for Go.

Features

Installation

msgpack supports 2 last Go versions and requires support for Go modules. So make sure to initialize a Go module:

go mod init github.com/my/repo

And then install msgpack/v5 (note v5 in the import; omitting it is a popular mistake):

go get github.com/vmihailenco/msgpack/v5

Quickstart

import"github.com/vmihailenco/msgpack/v5"funcExampleMarshal() {
typeItemstruct {
Foostring
}
b, err:=msgpack.Marshal(&Item{Foo: "bar"})
iferr!=nil {
panic(err)
}
varitemItemerr=msgpack.Unmarshal(b, &item)
iferr!=nil {
panic(err)
}
fmt.Println(item.Foo)
// Output: bar
}

About

msgpack.org[Go] MessagePack encoding for Golang

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages