Skip to content

vmihailenco/msgpack

v5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
December 29, 2021 10:46
October 23, 2020 17:07
October 1, 2020 11:43
March 18, 2021 13:27
October 22, 2021 13:23
June 17, 2017 15:19
October 22, 2021 13:09
July 26, 2023 16:43
November 27, 2020 18:20
October 24, 2020 08:55
October 23, 2020 17:07
March 16, 2021 10:42
October 23, 2020 17:07
March 16, 2021 10:42
v5
April 3, 2020 15:31
January 24, 2022 09:46
October 23, 2020 17:07
March 18, 2021 13:27
February 3, 2021 12:53
October 25, 2020 15:17
October 27, 2020 09:13
October 25, 2020 15:17
January 11, 2020 09:19
May 28, 2021 15:55
March 24, 2021 09:53

MessagePack encoding for Golang

Build Status PkgGoDev Documentation Chat

msgpack is brought to you by ⭐ uptrace/uptrace. Uptrace is an open source APM and blazingly fast distributed tracing tool powered by OpenTelemetry and ClickHouse. Give it a star as well!

Resources

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
}

See also

Contributors

Thanks to all the people who already contributed!