easier, faster, but extendable MessagePack Serializer for Golang. / msgpack.org[Go]
Go
186
399 commits
updated Oct 11, 2026
time.Time decoding defaults to UTC in v3Starting with v3.0.0, when decoding MessagePack Timestamp into Go’s time.Time,
the default Location will be UTC (previously Local). The instant is unchanged.
To keep the old behavior, use SetDecodedTimeAsLocal().
msgpack:"field_name"msgpack:"-"msgpack:"field_name,omitempty"Current version is msgpack/v3.
go get -u github.com/shamaton/msgpack/v3
If you are upgrading from v2, please note the time.Time decoding change mentioned in the announcement above.
To keep the v2 behavior, use msgpack.SetDecodedTimeAsLocal() after upgrading.
package main
import (
"github.com/shamaton/msgpack/v3"
"net/http"
)
type Struct struct {
String string
}
// simple
func main() {
v := Struct{String: "msgpack"}
d, err := msgpack.Marshal(v)
if err != nil {
panic(err)
}
r := Struct{}
if err = msgpack.Unmarshal(d, &r); err != nil {
panic(err)
}
}
// streaming
func handle(w http.ResponseWriter, r *http.Request) {
var body Struct
if err := msgpack.UnmarshalRead(r, &body); err != nil {
panic(err)
}
if err := msgpack.MarshalWrite(w, body); err != nil {
panic(err)
}
}
time.Time decoding defaults to UTCTL;DR: Starting with v3.0.0, when decoding MessagePack Timestamp into Go’s time.Time, the default Location will be UTC (previously Local). The instant is unchanged—only the display/location changes. This avoids host-dependent differences and aligns with common distributed systems practice.
time.Time defaults to Local.time.Time defaults to UTC.MessagePack’s Timestamp encodes an instant (epoch seconds + nanoseconds) and does not carry timezone info. Your data’s point in time is the same; only time.Time.Location() differs.
If you want the v2 behavior on v3:
msgpack.SetDecodedTimeAsLocal()
Or convert after the fact:
var t time.Time
_ = msgpack.Unmarshal(data, &t)
t = t.In(time.Local)
You can opt into UTC today on v2.x:
msgpack.SetDecodedTimeAsUTC()
These results are recorded by msgpack_bench.
Our package results show in Shamaton. Prefix ShamatonGen shows another our messagepack serialization library. See also: msgpackgen.
This library is under the MIT License. See the LICENSE file for details.
Overall
Maintained
Code review
Go module
Latest release
Releases this year
543 followers · starred Apr 2022
64 followers · starred Apr 2021
241 followers · starred May 2026
easier, faster, but extendable MessagePack Serializer for Golang. / msgpack.org[Go]
Go
186
399 commits
updated Oct 11, 2026
time.Time decoding defaults to UTC in v3Starting with v3.0.0, when decoding MessagePack Timestamp into Go’s time.Time,
the default Location will be UTC (previously Local). The instant is unchanged.
To keep the old behavior, use SetDecodedTimeAsLocal().
msgpack:"field_name"msgpack:"-"msgpack:"field_name,omitempty"Current version is msgpack/v3.
go get -u github.com/shamaton/msgpack/v3
If you are upgrading from v2, please note the time.Time decoding change mentioned in the announcement above.
To keep the v2 behavior, use msgpack.SetDecodedTimeAsLocal() after upgrading.
package main
import (
"github.com/shamaton/msgpack/v3"
"net/http"
)
type Struct struct {
String string
}
// simple
func main() {
v := Struct{String: "msgpack"}
d, err := msgpack.Marshal(v)
if err != nil {
panic(err)
}
r := Struct{}
if err = msgpack.Unmarshal(d, &r); err != nil {
panic(err)
}
}
// streaming
func handle(w http.ResponseWriter, r *http.Request) {
var body Struct
if err := msgpack.UnmarshalRead(r, &body); err != nil {
panic(err)
}
if err := msgpack.MarshalWrite(w, body); err != nil {
panic(err)
}
}
time.Time decoding defaults to UTCTL;DR: Starting with v3.0.0, when decoding MessagePack Timestamp into Go’s time.Time, the default Location will be UTC (previously Local). The instant is unchanged—only the display/location changes. This avoids host-dependent differences and aligns with common distributed systems practice.
time.Time defaults to Local.time.Time defaults to UTC.MessagePack’s Timestamp encodes an instant (epoch seconds + nanoseconds) and does not carry timezone info. Your data’s point in time is the same; only time.Time.Location() differs.
If you want the v2 behavior on v3:
msgpack.SetDecodedTimeAsLocal()
Or convert after the fact:
var t time.Time
_ = msgpack.Unmarshal(data, &t)
t = t.In(time.Local)
You can opt into UTC today on v2.x:
msgpack.SetDecodedTimeAsUTC()
These results are recorded by msgpack_bench.
Our package results show in Shamaton. Prefix ShamatonGen shows another our messagepack serialization library. See also: msgpackgen.
This library is under the MIT License. See the LICENSE file for details.
Overall
Maintained
Code review
Go module
Latest release
Releases this year
543 followers · starred Apr 2022
64 followers · starred Apr 2021
241 followers · starred May 2026