The Wayback Machine - https://web.archive.org/web/20231012211919/https://github.com/vmihailenco/msgpack
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

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
October 1, 2023 15:47
October 23, 2020 17:07
October 1, 2020 11:43
March 18, 2021 13:27
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
January 26, 2022 04:03
January 24, 2022 17:01
October 23, 2020 17:07
v5
April 3, 2020 15:31
October 23, 2020 17:07
February 3, 2021 12:53
October 27, 2020 09:13
January 26, 2022 04:03
January 11, 2020 09:19

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!