GoToSocial/vendor/github.com/vmihailenco/msgpack/v5
tobi 182b4eea73
Update dependencies (#333)
2021-11-27 15:26:58 +01:00
..
msgpcode
.prettierrc
.travis.yml
CHANGELOG.md Update dependencies (#333) 2021-11-27 15:26:58 +01:00
LICENSE
Makefile Update dependencies (#333) 2021-11-27 15:26:58 +01:00
README.md Update dependencies (#333) 2021-11-27 15:26:58 +01:00
commitlint.config.js Update dependencies (#333) 2021-11-27 15:26:58 +01:00
decode.go Update dependencies (#333) 2021-11-27 15:26:58 +01:00
decode_map.go
decode_number.go
decode_query.go
decode_slice.go
decode_string.go
decode_value.go
encode.go
encode_map.go Update dependencies (#333) 2021-11-27 15:26:58 +01:00
encode_number.go
encode_slice.go
encode_value.go
ext.go
intern.go
msgpack.go
package.json Update dependencies (#333) 2021-11-27 15:26:58 +01:00
safe.go
time.go
types.go
unsafe.go
version.go Update dependencies (#333) 2021-11-27 15:26:58 +01:00

README.md

MessagePack encoding for Golang

Build Status PkgGoDev Documentation Chat

❤️ 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"

func ExampleMarshal() {
    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)
    // Output: bar
}