msgpack.org[Go] MessagePack encoding for Golang

Overview

MessagePack encoding for Golang

Build Status PkgGoDev Documentation Chat

❤️ Uptrace.dev - distributed traces, logs, and errors in one place

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

Comments
  • msgpack packs int but decodes as uint64.

    msgpack packs int but decodes as uint64.

    I a using msgpack to encode a map ie: newmap["rate"] = 100 marshalledMap, _ := msgpack.Marshal(newmap) var valOut map[string]interface{} _ = msgpack.Unmarshal(marshalledMap, &valOut) reflect.TypeOf(valOut["rate"])

    uint64

    it should be packed as int or int64 and back it int or int64, not uint64.

    Example where it persists with json encoding end decoding but not with msgpack. https://play.golang.org/p/VaeYnkLPS3

    opened by elico 11
  • Add ability to pack/unpack struct as an array

    Add ability to pack/unpack struct as an array

    We use this package for connector to in-memory database tarantool . Tarantool uses msgpack arrays for its row types. Pack/unpack from a struct to msgpack array currently ought to go through CustomEncoder/CustomDecoder.

    Proposal is to add ability to point that struct should be packed/unpacked as an array without need for CustomEncoder/Decoder.

    ugorji/codec provides this ability through tags on specific field: https://godoc.org/github.com/ugorji/go/codec#Encoder.Encode

    However, struct values may encode as arrays. This happens when:

    • StructToArray Encode option is set, OR
    • the tag on the _struct field sets the "toarray" option
    opened by funny-falcon 10
  • Weird issue

    Weird issue

    I'm using msgpack format to store data in redis.

    After switching to your (fast!) lib I have this weird issue: on my local machine one of many test are failing inexplicably. But the same test passes when I am running the same test suite in a docker environment. Switching back to the old msgpack lib the tests are fine in both environments.

    Do you have any hints for me on where should I be looking to fix this?

    opened by rif 10
  • Issue with decoding embedded/inherited  structures

    Issue with decoding embedded/inherited structures

    Hello!

    We have some issue with decoding structure like this:

    type CryptoKeys struct { CDS []dns.CDS DNSKEY []dns.DNSKEY }

    We can decode DNSKEY without any issues (it implemented as standard structure without embedding https://godoc.org/github.com/miekg/dns#DNSKEY) but we cannot decode dns.CDS properly.

    We suppose some issues with embedded/inherited structures because dns.CDS implemented this way: https://godoc.org/github.com/miekg/dns#CDS

    Encoding side (https://github.com/tinylib/msgp) uses following approach to encode embedded structures: "CDS":[{"DS":{"Algorithm":13,"Digest":"4CD1F4CD1F854CD1F4CD1F85D1F85D14CD1F8585","DigestType":2,"Hdr":"","KeyTag":2371}}

    So, it just adds DS as field instead of embedding all fields into CDS structure.

    Is it possible to decode structures encoded this way using your library?

    Thank you!

    opened by pavel-odintsov 8
  • Add support for inlining struct fields.

    Add support for inlining struct fields.

    msgpack encoder differ in behaviour from the json one - the latter inlines fields of an embedded struct as they were part of the parent struct.

    While we can't change the behaviour due to compatibility reasons we can introduce inline opt, which will make the encoding similar in behaviour to the json one.

    /cc @vmihailenco Please take a look.

    opened by rjeczalik 8
  • Custom encoding requires access to op-code peeking

    Custom encoding requires access to op-code peeking

    Requires code constants to be public, but I don't see much harm in that as this implementation is unlikely to change. Added test to demonstrate the issue (e.g. detection and correct encoding/decoding of nil-values). Benchmark results are below:

    master:

    BenchmarkBool 10000000         118 ns/op         0 B/op        0 allocs/op
    BenchmarkInt0 10000000         123 ns/op         0 B/op        0 allocs/op
    BenchmarkInt1 10000000         167 ns/op         0 B/op        0 allocs/op
    BenchmarkInt2  5000000         244 ns/op         0 B/op        0 allocs/op
    BenchmarkInt4  5000000         246 ns/op         0 B/op        0 allocs/op
    BenchmarkInt8  5000000         267 ns/op         0 B/op        0 allocs/op
    BenchmarkIntBinary   3000000         440 ns/op        24 B/op        3 allocs/op
    BenchmarkIntMsgpack2   2000000         793 ns/op         8 B/op        1 allocs/op
    BenchmarkIntMsgpack3   2000000         699 ns/op         8 B/op        1 allocs/op
    BenchmarkTime  3000000         464 ns/op         0 B/op        0 allocs/op
    BenchmarkDuration  5000000         266 ns/op         0 B/op        0 allocs/op
    BenchmarkBytes    500000        2573 ns/op      1024 B/op        1 allocs/op
    BenchmarkMapStringString   1000000        1515 ns/op        16 B/op        4 allocs/op
    BenchmarkMapStringStringPtr   300000        3996 ns/op       208 B/op       12 allocs/op
    BenchmarkMapIntInt    300000        4847 ns/op       384 B/op       16 allocs/op
    BenchmarkStringSlice   2000000         671 ns/op        10 B/op        2 allocs/op
    BenchmarkStringSlicePtr  1000000        1564 ns/op        74 B/op        4 allocs/op
    BenchmarkStruct   100000       18352 ns/op      3145 B/op       28 allocs/op
    BenchmarkStructManual   200000       11246 ns/op      2720 B/op       21 allocs/op
    BenchmarkStructMsgpack2    50000       25506 ns/op      3616 B/op       70 allocs/op
    BenchmarkStructMsgpack3    50000       31869 ns/op      5550 B/op       37 allocs/op
    BenchmarkStructJSON    10000      121426 ns/op      9336 B/op       30 allocs/op
    BenchmarkStructGOB     10000      170774 ns/op     23925 B/op      450 allocs/op
    BenchmarkCSV    100000       20378 ns/op      8764 B/op       13 allocs/op
    BenchmarkCSVMsgpack   500000        2434 ns/op       384 B/op       13 allocs/op
    

    custom-peeking:

    BenchmarkBool 10000000         125 ns/op         0 B/op        0 allocs/op
    BenchmarkInt0 10000000         139 ns/op         0 B/op        0 allocs/op
    BenchmarkInt1 10000000         177 ns/op         0 B/op        0 allocs/op
    BenchmarkInt2  5000000         274 ns/op         0 B/op        0 allocs/op
    BenchmarkInt4  5000000         270 ns/op         0 B/op        0 allocs/op
    BenchmarkInt8  5000000         291 ns/op         0 B/op        0 allocs/op
    BenchmarkIntBinary   3000000         462 ns/op        24 B/op        3 allocs/op
    BenchmarkIntMsgpack2   2000000         796 ns/op         8 B/op        1 allocs/op
    BenchmarkIntMsgpack3   2000000         700 ns/op         8 B/op        1 allocs/op
    BenchmarkTime  3000000         490 ns/op         0 B/op        0 allocs/op
    BenchmarkDuration  5000000         276 ns/op         0 B/op        0 allocs/op
    BenchmarkBytes    500000        2700 ns/op      1024 B/op        1 allocs/op
    BenchmarkMapStringString   1000000        1614 ns/op        16 B/op        4 allocs/op
    BenchmarkMapStringStringPtr   300000        4336 ns/op       208 B/op       12 allocs/op
    BenchmarkMapIntInt    300000        4993 ns/op       384 B/op       16 allocs/op
    BenchmarkStringSlice   2000000         750 ns/op        10 B/op        2 allocs/op
    BenchmarkStringSlicePtr  1000000        1573 ns/op        74 B/op        4 allocs/op
    BenchmarkStruct   100000       18735 ns/op      3143 B/op       28 allocs/op
    BenchmarkStructManual   200000       11052 ns/op      2720 B/op       21 allocs/op
    BenchmarkStructMsgpack2    50000       27786 ns/op      3616 B/op       70 allocs/op
    BenchmarkStructMsgpack3    50000       31579 ns/op      5550 B/op       37 allocs/op
    BenchmarkStructJSON    10000      124445 ns/op      9337 B/op       30 allocs/op
    BenchmarkStructGOB     10000      184581 ns/op     23925 B/op      450 allocs/op
    BenchmarkCSV    100000       19866 ns/op      8764 B/op       13 allocs/op
    BenchmarkCSVMsgpack   500000        2634 ns/op       384 B/op       13 allocs/op
    
    opened by dim 8
  • Problems with unmarshalling of structs with interface fields

    Problems with unmarshalling of structs with interface fields

    Hi! I try to use Msgpack to marshal structs with interface fields. During the unmarshal, the library panics. Here is an example: https://gist.github.com/giggsoff/b261040fb97f9ff8f81145a5ed440ec3 And I got:

    2020/05/23 20:15:20 Before marshalling:  &{123}
    panic: reflect.Set: value of type map[string]interface {} is not assignable to type main.interfaceAlias
    
    goroutine 1 [running]:
    reflect.Value.assignTo(0x4df9a0, 0xc000098420, 0x15, 0x4fe6dc, 0xb, 0x4e1ac0, 0xc000096530, 0xc000098420, 0x0, 0x0)
            /snap/go/5759/src/reflect/value.go:2403 +0x426
    reflect.Value.Set(0x4e1ac0, 0xc000096530, 0x194, 0x4df9a0, 0xc000098420, 0x15)
            /snap/go/5759/src/reflect/value.go:1532 +0xbd
    github.com/vmihailenco/msgpack/v4.(*Decoder).interfaceValue(0xc0000ce000, 0x4e1ac0, 0xc000096530, 0x194, 0x4e1ac0, 0xc000096530)
            /home/giggsoff/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/decode_value.go:247 +0x150
    github.com/vmihailenco/msgpack/v4.decodeInterfaceValue(0xc0000ce000, 0x4e1ac0, 0xc000096530, 0x194, 0x1, 0x1)
            /home/giggsoff/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/decode_value.go:219 +0x1ef
    github.com/vmihailenco/msgpack/v4.(*field).DecodeValue(0xc0000bc0c0, 0xc0000ce000, 0x4e2b60, 0xc000096530, 0x199, 0xc000096430, 0x4e7680)
            /home/giggsoff/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/types.go:110 +0x9b
    github.com/vmihailenco/msgpack/v4.decodeStructValue(0xc0000ce000, 0x4e2b60, 0xc000096530, 0x199, 0x4e2b60, 0x7f27962e50c8)
            /home/giggsoff/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/decode_map.go:333 +0x462
    github.com/vmihailenco/msgpack/v4.(*Decoder).DecodeValue(0xc0000ce000, 0x4e2b60, 0xc000096530, 0x199, 0xc000096530, 0x199)
            /home/giggsoff/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/decode.go:280 +0x8c
    github.com/vmihailenco/msgpack/v4.(*Decoder).Decode(0xc0000ce000, 0x4d2ce0, 0xc000096530, 0xc000093ed8, 0x40beb8)
            /home/giggsoff/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/decode.go:259 +0x171
    github.com/vmihailenco/msgpack/v4.Unmarshal(0xc0000cc040, 0xe, 0x40, 0x4d2ce0, 0xc000096530, 0x0, 0x0)
            /home/giggsoff/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/decode.go:51 +0xcb
    main.main()
            /home/giggsoff/go/src/msgpackTest/customIf/main.go:40 +0x1c4
    exit status 2
    

    When I initialize struct before unmarshalling to it here https://gist.github.com/giggsoff/65606a03d84288000f0cd01684eb1b48 I got wrong result (expected result is the same lines):

    2020/05/23 20:43:32 Before marshalling:  &{123}
    2020/05/23 20:43:32 After marshalling:  &{0 456}
    

    And I cannot use library in app https://github.com/lf-edge/adam/pull/32

    opened by giggsoff 7
  • decode exception, bug?

    decode exception, bug?

    go version go1.9.1 windows/amd64

    package main
    
    import (
    	"bytes"
    	"fmt"
    
    	"github.com/vmihailenco/msgpack"
    )
    
    type Abc struct {
    	BB   int
    	Haha int
    }
    
    type Msg struct {
    	ID  int
    	Inf interface{}
    }
    
    func main() {
    
    	var msg Msg
    	msg.Inf = Abc{BB: 2, Haha: 3}
    	var buf bytes.Buffer
    	msgpack.NewEncoder(&buf).StructAsArray(true).Encode(msg)
    	data := buf.Bytes()
    
    	{
    		var msgD Msg
    		infD := &Abc{}
    		msgD.Inf = infD
    		msgpack.Unmarshal(data, &msgD)
    		fmt.Println(msgD, infD)
    	}
    
    	{
    		var msgD Msg
    		infD := Abc{}
    		msgD.Inf = infD
    		msgpack.Unmarshal(data, &msgD)  // panic here
    		fmt.Println(msgD)
    	}
    
    }
    
    
    d:\code\code>code.exe
    {0 0xc04200e130} &{2 3}
    panic: reflect: reflect.Value.SetInt using unaddressable value
    
    goroutine 1 [running]:
    reflect.flag.mustBeAssignable(0x82)
            D:/go/src/reflect/value.go:228 +0x184
    reflect.Value.SetInt(0x4d0520, 0xc04200e170, 0x82, 0x2)
            D:/go/src/reflect/value.go:1420 +0x36
    github.com/vmihailenco/msgpack.decodeInt64Value(0xc0420380c0, 0x4d0520, 0xc04200e170, 0x82, 0x4d0520, 0xc04200e170)
            D:/golib/src/github.com/vmihailenco/msgpack/decode_number.go:279 +0x85
    github.com/vmihailenco/msgpack.(*field).DecodeValue(0xc042036140, 0xc0420380c0, 0x4dd300, 0xc04200e170, 0x99, 0x4daa20, 0x4cb200)
            D:/golib/src/github.com/vmihailenco/msgpack/types.go:93 +0x89
    github.com/vmihailenco/msgpack.decodeStructValue(0xc0420380c0, 0x4dd300, 0xc04200e170, 0x99, 0x4dd300, 0xc04200e170)
            D:/golib/src/github.com/vmihailenco/msgpack/decode_map.go:236 +0x196
    github.com/vmihailenco/msgpack.(*Decoder).DecodeValue(0xc0420380c0, 0x4dd300, 0xc04200e170, 0x99, 0xc04200e170, 0x99)
            D:/golib/src/github.com/vmihailenco/msgpack/decode.go:201 +0x93
    github.com/vmihailenco/msgpack.decodeInterfaceValue(0xc0420380c0, 0x4d7880, 0xc0420024a8, 0x194, 0x4d7880, 0xc0420024a8)
            D:/golib/src/github.com/vmihailenco/msgpack/decode_value.go:241 +0xeb
    github.com/vmihailenco/msgpack.(*field).DecodeValue(0xc042036100, 0xc0420380c0, 0x4dd3a0, 0xc0420024a0, 0x199, 0x0, 0x0)
            D:/golib/src/github.com/vmihailenco/msgpack/types.go:93 +0x89
    github.com/vmihailenco/msgpack.decodeStructValue(0xc0420380c0, 0x4dd3a0, 0xc0420024a0, 0x199, 0x4dd3a0, 0xc0420024a0)
            D:/golib/src/github.com/vmihailenco/msgpack/decode_map.go:236 +0x196
    github.com/vmihailenco/msgpack.(*Decoder).DecodeValue(0xc0420380c0, 0x4dd3a0, 0xc0420024a0, 0x199, 0xc0420024a0, 0x199)
            D:/golib/src/github.com/vmihailenco/msgpack/decode.go:201 +0x93
    github.com/vmihailenco/msgpack.(*Decoder).decode(0xc0420380c0, 0x4cb240, 0xc0420024a0, 0x4daca0, 0x4e7dc0)
            D:/golib/src/github.com/vmihailenco/msgpack/decode.go:196 +0x123
    github.com/vmihailenco/msgpack.(*Decoder).Decode(0xc0420380c0, 0xc042061ec8, 0x1, 0x1, 0xc042058240, 0x1)
            D:/golib/src/github.com/vmihailenco/msgpack/decode.go:82 +0x76
    github.com/vmihailenco/msgpack.Unmarshal(0xc042066028, 0x5, 0x40, 0xc042061ec8, 0x1, 0x1, 0x0, 0x0)
            D:/golib/src/github.com/vmihailenco/msgpack/decode.go:36 +0x237
    main.main()
            d:/code/code/gotest.go:40 +0x545
    
    opened by dearplain 7
  • Fallback to json struct tag if no msgpack tag is present

    Fallback to json struct tag if no msgpack tag is present

    This change is related to #149 and adds fallback option to json: struct tags if no msgpack: tags are found. This is useful if you want to serialize a generated struct that already has the json: tags and you want to msgpack it as well. Sure, it can be abused, but I think it's common enough and may help people transition to msgpack when they need it.

    I need this in my current project and this seems to work okay for us. That said, I can understand your concerns if you don't want to support it.

    opened by gsamokovarov 7
  • Can performance be improved for deserializing only subset of fields

    Can performance be improved for deserializing only subset of fields

    I use msgpack serialization for storing about 10 billion records. Each record has around 15 fields in a go struct. The most common use case is that of reading from this set and examining some fields to do processing. In the whole process, I realized that most of the time is being spent in msgpack deserialization to map[string]interface{}.

    I noticed that I usually only read a small subset of the fields. Is there a way to improve deserialization performance by only reading those fields I need? (I tried defining a struct with only those fields but that made performance worse than using a map[string]interface{}).

    Something along the lines of the following might be useful.

    type SubData struct {
        Y string
    }
    
    type Record struct {
        A int
        B SubData
        C int
        D string
        E []int
        F bool
    }
    
    A := msgpack.DeserializeInt(record_bytes, "A")
    B := msgpack.DeserializeString(record_bytes, "B.Y")
    

    or

    type DeserializedSubData struct {
        Y string
    }
    
    type DeserializedRecord struct {
        A int
        B DeserializedSubData
    }
    
    var d DeserializedRecord
    msgpack.Deserialize(record_bytes, &d)
    

    Please note that the second case works currently but performance isn't any better for reading only some fields.

    opened by prashanthellina 7
  • Omit empty simple sturcts

    Omit empty simple sturcts

    Currently, we only omit default values for primitives, interfaces and, pointers. This makes it difficult to determine if a primitive was present in the unpacked message.

    Whilst unpacking you can determine if a value is present by implementing something similar to standard lib's database/sql.NullInt64 (or any of the other Null* types), but then the "Valid" field will be included when you marshal the struct.

    To resovle this, we must check if the given struct is simple enough (meaning it doesn't have any hidden fields) to compare to a zero-initialized version of the struct. If it is simple enough, and the provided struct is zero-initialized, and the struct is tagged with "omitempty" we can exclude it from the resulting bytes.

    opened by mthjs 6
  • marshal []bytes  panic

    marshal []bytes panic

    env: go 1.8 ubuntu 20

    code:

    type Data struct {
    	Key         []byte `json:"key"`
    }
    
    func (d *Data) MarshalBinary() ([]byte, error) {
    	return msgpack.Marshal(d)
    }
    
    func (d *Data) UnmarshalBinary(data []byte) error {
    	return msgpack.Unmarshal(data, d)
    }
    func main() {
    	b, err := msgpack.Marshal(&Data{
    		Key:         []byte("123"),
    	})
    	fmt.Println(string(b), err)
    }
    

    error: runtime: goroutine stack exceeds 1000000000-byte limit runtime: sp=0x40203c0390 stack=[0x40203c0000, 0x40403c0000] fatal error: stack overflow

    runtime stack: runtime.throw({0x6c51bf?, 0xb7eb60?}) /usr/local/go/src/runtime/panic.go:992 +0x50 runtime.newstack() /usr/local/go/src/runtime/stack.go:1101 +0x47c runtime.morestack() /usr/local/go/src/runtime/asm_arm64.s:310 +0x70

    goroutine 1 [running]: runtime.heapBitsSetType(0x400d5f8f00?, 0x60?, 0x60?, 0x6759c0?) /usr/local/go/src/runtime/mbitmap.go:832 +0x998 fp=0x40203c0390 sp=0x40203c0390 pc=0x25a18 runtime.mallocgc(0x60, 0x6759c0, 0x1) /usr/local/go/src/runtime/malloc.go:1117 +0x5f8 fp=0x40203c0400 sp=0x40203c0390 pc=0x1d358 runtime.newobject(0x40203c0478?) /usr/local/go/src/runtime/malloc.go:1259 +0x30 fp=0x40203c0430 sp=0x40203c0400 pc=0x1d790 github.com/vmihailenco/msgpack/v5.NewEncoder(...) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:91 github.com/vmihailenco/msgpack/v5.glob..func2() /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:46 +0x40 fp=0x40203c0490 sp=0x40203c0430 pc=0x3cc220 sync.(*Pool).Get(0xbac360) /usr/local/go/src/sync/pool.go:148 +0xc0 fp=0x40203c04d0 sp=0x40203c0490 pc=0x7cb70 github.com/vmihailenco/msgpack/v5.GetEncoder(...) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:51 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:61 +0x30 fp=0x40203c0560 sp=0x40203c04d0 pc=0x3cc390 main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c0580 sp=0x40203c0560 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8ea0, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c05c0 sp=0x40203c0580 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c0648?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c0610 sp=0x40203c05c0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c0650 sp=0x40203c0610 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c06e0 sp=0x40203c0650 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c0700 sp=0x40203c06e0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8e40, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c0740 sp=0x40203c0700 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c07c8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c0790 sp=0x40203c0740 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c07d0 sp=0x40203c0790 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/v[email protected]/encode.go:66 +0x15c fp=0x40203c0860 sp=0x40203c07d0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c0880 sp=0x40203c0860 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8de0, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c08c0 sp=0x40203c0880 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c0948?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c0910 sp=0x40203c08c0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c0950 sp=0x40203c0910 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/v5@v5.3.5/encode.go:66 +0x15c fp=0x40203c09e0 sp=0x40203c0950 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c0a00 sp=0x40203c09e0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8d80, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c0a40 sp=0x40203c0a00 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c0ac8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c0a90 sp=0x40203c0a40 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c0ad0 sp=0x40203c0a90 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c0b60 sp=0x40203c0ad0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c0b80 sp=0x40203c0b60 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8d20, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c0bc0 sp=0x40203c0b80 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c0c48?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c0c10 sp=0x40203c0bc0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c0c50 sp=0x40203c0c10 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c0ce0 sp=0x40203c0c50 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c0d00 sp=0x40203c0ce0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8cc0, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c0d40 sp=0x40203c0d00 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c0dc8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c0d90 sp=0x40203c0d40 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c0dd0 sp=0x40203c0d90 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c0e60 sp=0x40203c0dd0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c0e80 sp=0x40203c0e60 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8c60, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c0ec0 sp=0x40203c0e80 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c0f48?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c0f10 sp=0x40203c0ec0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c0f50 sp=0x40203c0f10 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c0fe0 sp=0x40203c0f50 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1000 sp=0x40203c0fe0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8c00, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c1040 sp=0x40203c1000 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c10c8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1090 sp=0x40203c1040 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c10d0 sp=0x40203c1090 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c1160 sp=0x40203c10d0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1180 sp=0x40203c1160 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8ba0, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c11c0 sp=0x40203c1180 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c1248?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1210 sp=0x40203c11c0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c1250 sp=0x40203c1210 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c12e0 sp=0x40203c1250 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1300 sp=0x40203c12e0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8b40, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c1340 sp=0x40203c1300 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c13c8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1390 sp=0x40203c1340 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c13d0 sp=0x40203c1390 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c1460 sp=0x40203c13d0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1480 sp=0x40203c1460 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8ae0, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c14c0 sp=0x40203c1480 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c1548?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1510 sp=0x40203c14c0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c1550 sp=0x40203c1510 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c15e0 sp=0x40203c1550 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1600 sp=0x40203c15e0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8a80, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c1640 sp=0x40203c1600 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c16c8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1690 sp=0x40203c1640 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c16d0 sp=0x40203c1690 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c1760 sp=0x40203c16d0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1780 sp=0x40203c1760 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8a20, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c17c0 sp=0x40203c1780 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c1848?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1810 sp=0x40203c17c0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c1850 sp=0x40203c1810 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c18e0 sp=0x40203c1850 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1900 sp=0x40203c18e0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f89c0, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c1940 sp=0x40203c1900 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c19c8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1990 sp=0x40203c1940 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c19d0 sp=0x40203c1990 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c1a60 sp=0x40203c19d0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1a80 sp=0x40203c1a60 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8960, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c1ac0 sp=0x40203c1a80 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c1b48?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1b10 sp=0x40203c1ac0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c1b50 sp=0x40203c1b10 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c1be0 sp=0x40203c1b50 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1c00 sp=0x40203c1be0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8900, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c1c40 sp=0x40203c1c00 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c1cc8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1c90 sp=0x40203c1c40 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c1cd0 sp=0x40203c1c90 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c1d60 sp=0x40203c1cd0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1d80 sp=0x40203c1d60 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f88a0, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c1dc0 sp=0x40203c1d80 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c1e48?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1e10 sp=0x40203c1dc0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c1e50 sp=0x40203c1e10 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c1ee0 sp=0x40203c1e50 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c1f00 sp=0x40203c1ee0 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f8840, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c1f40 sp=0x40203c1f00 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c1fc8?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c1f90 sp=0x40203c1f40 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c1fd0 sp=0x40203c1f90 pc=0x3cceb0 github.com/vmihailenco/msgpack/v5.Marshal({0x61d460, 0x4000070900}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:66 +0x15c fp=0x40203c2060 sp=0x40203c1fd0 pc=0x3cc4bc main.(*Data).MarshalBinary(0x61d460?) /media/psf/code/dubai_common/test2.go:56 +0x2c fp=0x40203c2080 sp=0x40203c2060 pc=0x59abcc github.com/vmihailenco/msgpack/v5.marshalBinaryValue(0x400d5f87e0, {0x61d460?, 0x4000070900?, 0xffff426ccb58?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode_value.go:216 +0x104 fp=0x40203c20c0 sp=0x40203c2080 pc=0x3d1da4 github.com/vmihailenco/msgpack/v5.(*Encoder).EncodeValue(0x40203c2148?, {0x61d460?, 0x4000070900?, 0x694680?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:239 +0x68 fp=0x40203c2110 sp=0x40203c20c0 pc=0x3cd038 github.com/vmihailenco/msgpack/v5.(*Encoder).Encode(0xbac360?, {0x61d460?, 0x4000070900?}) /home/qfy/go/pkg/mod/github.com/vmihailenco/msgpack/[email protected]/encode.go:225 +0x370 fp=0x40203c2150 sp=0x40203c2110 pc=0x3cceb0 exit status 2

    opened by qianxiansheng90 1
  • panic: reflect: reflect.Value.SetString using unaddressable value

    panic: reflect: reflect.Value.SetString using unaddressable value

    This code will panic, And I found it is because of github.com/vmihailenco/msgpack/v5/decode_ value.go:130, Therefore, if I replace S1 with a null pointer, there will be no panic. Is this a bug

    image
    func TestMsgpack(t *testing.T) {
    	type demo struct{}
    	t1 := []interface{}{nil}
    	data, _ := Marshal(t1)
    	//var s1 *demo
    	s1 := new(demo)
    	us := []interface{}{s1}
    	Unmarshal(data, &us)
    
    }
    
    func Marshal(v interface{}) ([]byte, error) {
    	enc := msgpack.GetEncoder()
    	defer msgpack.PutEncoder(enc)
    
    	var buf bytes.Buffer
    	enc.Reset(&buf)
    
    	err := enc.Encode(v)
    	if err != nil {
    		return nil, err
    	}
    	return buf.Bytes(), err
    }
    
    func Unmarshal(data []byte, v interface{}) error {
    	dec := msgpack.GetDecoder()
    	defer msgpack.PutDecoder(dec)
    
    	dec.Reset(bytes.NewReader(data))
    	err := dec.Decode(v)
    
    	return err
    }
    
    opened by TXYH1 0
  • Why NewDecoder return zero response ?

    Why NewDecoder return zero response ?

    Why NewDecoder return zero value ?, and not return value from jph, but if i try with json encoding, i'm get response back from jph like this {1 Leanne Graham [email protected]}.

    Code

    package main
    
    import (
    	"fmt"
    	"net/http"
    
    	"github.com/vmihailenco/msgpack/v5"
    )
    
    type Person struct {
    	ID    int    `json:"id"`
    	Name  string `json:"name"`
    	Email string `json:"email"`
    }
    
    func main() {
    	payload := Person{}
    
    	fetch, _ := http.Get("https://jsonplaceholder.typicode.com/users/1")
    	msgpack.NewDecoder(fetch.Body).Decode(&payload)
    	defer fetch.Body.Close()
    
    	fmt.Println(payload)
    }
    

    Response

    {0  }
    
    opened by restuwahyu13 0
  • panic: reflect: reflect.Value.SetString using unaddressable value

    panic: reflect: reflect.Value.SetString using unaddressable value

    HI,

    Facing an issue while using the plugin to marshal / unmarshal a non initialized empty struct (only declared)

    Below code shows multiple type of objects getting marshalled / unmarshalled using the library.

    We have been trying to use the test2 function approach and getting the following panic: panic: reflect: reflect.Value.SetString using unaddressable value

    Can someone please confirm on the following:

    1. Is it expected to break (if yes why) or is it a bug which we are planning to fix/handle in the near future?
    2. If its expected to break then anyway we can handle and make it work at our end?
    3. Can some conceptual understanding be provided on why is the plugin written in a way that it works for all the other cases but not only for test2.
    package main
    
    import (
    	"fmt"
    	"github.com/vmihailenco/msgpack/v5"
    )
    
    type ABC struct {
    	SampleInt    int    `msgpack:"Abc"`
    	SampleBool   bool   `msgpack:"Xyz"`
    	SampleString string `msgpack:"Efg"`
    }
    
    func main() {
    	//test1() //works
    	test2() //doesn't work
    	//test3() //works
    	//test4() //works
    }
    
    func test1() {
    	var test ABC
    	var test2 ABC
    	max := marshal(&test, &test2)
    
    	var test5 ABC
    	var test6 ABC
    	unmarshal(max, &test5, &test6)
    	fmt.Println(test5, test6)
    }
    
    func test2() {
    	var test []ABC
    	var test2 []ABC
    	max := marshal(&test, &test2)
    
    	var test5 []ABC
    	var test6 []ABC
    	unmarshal(max, &test5, &test6)
    	fmt.Println(test5, test6)
    }
    
    func test3() {
    
    	test := []ABC{}
    	test2 := []ABC{}
    	max := marshal(&test, &test2)
    
    	test5 := []ABC{}
    	test6 := []ABC{}
    	unmarshal(max, &test5, &test6)
    	fmt.Println(test5, test6)
    }
    
    func test4() {
    
    	abc1 := ABC{100, false, "Full-Stack Developer"}
    	abc2 := ABC{100, false, "Full-Stack Developer"}
    
    	test := []ABC{abc1, abc2}
    	test2 := []ABC{abc1, abc2}
    	max := marshal(&test, &test2)
    
    	test5 := []ABC{}
    	test6 := []ABC{}
    	unmarshal(max, &test5, &test6)
    	fmt.Println(test5, test6)
    }
    
    func marshal(test ...interface{}) string {
    	a, _ := msgpack.Marshal(test)
    	return string(a)
    }
    
    func unmarshal(marsh string, dest ...interface{}) {
    	if dest != nil {
    		err := msgpack.Unmarshal([]byte(marsh), &dest)
    		fmt.Println(err)
    	}
    }
    
    

    Hoping to hear from you soon.

    Thanks in advance.

    opened by VibhorGupta1991 1
Owner
Vladimir Mihailenco
Vladimir Mihailenco
Implements the XDR standard as specified in RFC 4506 in pure Go (Golang)

go-xdr [] (https://travis-ci.org/davecgh/go-xdr) [![Coverage Status] (https://coveralls.io/repos/davecgh/go-xdr/badge.png?branch=master)] (https://cov

Dave Collins 100 Dec 15, 2022
msgpack.org[Go] MessagePack encoding for Golang

MessagePack encoding for Golang ❤️ Uptrace.dev - All-in-one tool to optimize performance and monitor errors & logs Join Discord to ask questions. Docu

Vladimir Mihailenco 1.9k Dec 28, 2022
idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]

go-codec This repository contains the go-codec library, the codecgen tool and benchmarks for comparing against other libraries. This is a High Perform

Ugorji Nwoke 1.7k Dec 19, 2022
Github-org-diff - Simple CLI tool to check a diff between 2 branches of all org repos

github-org-diff Simple CLI tool to list org repos that have diff between dev and

Alex Pliutau 1 Jan 25, 2022
Library to integrate github.com/google/uuid with gopkg.in/vmihailenco/msgpack

Library to integrate github.com/google/uuid with gopkg.in/vmihailenco/msgpack

Citilink LLC 73 Apr 26, 2022
go-eexcel implements encoding and decoding of XLSX like encoding/json

go-eexcel go-eexcel implements encoding and decoding of XLSX like encoding/json Usage func ExampleMarshal() { type st struct { Name string `eexce

sago35 0 Dec 9, 2021
High-performance minimalist queue implemented using a stripped-down lock-free ringbuffer, written in Go (golang.org)

This project is no longer maintained - feel free to fork the project! gringo A high-performance minimalist queue implemented using a stripped-down loc

Darren Elwood 129 Oct 24, 2022
A URL shortener using http://is.gd/ and the Go programming language (http://golang.org/)

goisgd A simple command line URL shortener using http://is.gd/. Getting the Code go get github.com/NickPresta/GoURLShortener Usage Import this librar

Nick Presta 22 Apr 6, 2022
Golang (Go) bindings for GNU's gettext (http://www.gnu.org/software/gettext/)

gosexy/gettext Go bindings for GNU gettext, an internationalization and localization library for writing multilingual systems. Requeriments GNU gettex

Go toolbelt 62 Nov 16, 2022
Go (golang) implementation of http://www.hashids.org

go-hashids Go (golang) v1 implementation of http://www.hashids.org under MIT License (same as the original implementations) Original implementations b

Rémi Gillig 1.2k Jan 1, 2023
Use golang.org/x/vuln to scan your dependencies

vulnz - Use golang.org/x/vuln to scan your dependencies vulnz uses golang.org/x/vuln to scan the dependencies in your go.mod. Install go install githu

Miki Tebeka 2 Oct 10, 2022
my fork from google.golang.org/protobuf

Go support for Protocol Buffers This project hosts the Go implementation for protocol buffers, which is a language-neutral, platform-neutral, extensib

Sebastian Chamena 0 Dec 22, 2021
This is repository for Simple HTTP GET golang app that counts standard deviation from random.org integers

Simple Get Deviation App This is repository for Simple HTTP GET golang app that counts standard deviation from random.org integers IMPORTANT: Because

null 0 Jan 10, 2022
Asn.1 BER and DER encoding library for golang.

WARNING This repo has been archived! NO further developement will be made in the foreseen future. asn1 -- import "github.com/PromonLogicalis/asn1" Pac

Logicalis 53 Nov 14, 2022
Fast implementation of base58 encoding on golang.

Fast Implementation of Base58 encoding Fast implementation of base58 encoding in Go. Base algorithm is adapted from https://github.com/trezor/trezor-c

Denis Subbotin 128 Dec 9, 2022
A simple, semantic and developer-friendly golang package for encoding&decoding and encryption&decryption

A simple, semantic and developer-friendly golang package for encoding&decoding and encryption&decryption

null 551 Jan 4, 2023
encLib is a simple golang package for quickly encoding and decoding string data in hex

encLib is a simple golang package for quickly encoding and decoding string data in hex

null 0 Nov 1, 2021
Some Golang types based on builtin. Implements interfaces Value / Scan and MarshalJSON / UnmarshalJSON for simple working with database NULL-values and Base64 encoding / decoding.

gotypes Some simple types based on builtin Golang types that implement interfaces for working with DB (Scan / Value) and JSON (Marshal / Unmarshal). N

null 0 Feb 12, 2022
Intuitive package for prettifying terminal/console output. http://godoc.org/github.com/ttacon/chalk

chalk Chalk is a go package for styling console/terminal output. Check out godoc for some example usage: http://godoc.org/github.com/ttacon/chalk The

Trey Tacon 418 Dec 23, 2022
A Go library for an efficient implementation of a skip list: https://godoc.org/github.com/MauriceGit/skiplist

Fast Skiplist Implementation This Go-library implements a very fast and efficient Skiplist that can be used as direct substitute for a balanced tree o

Maurice Tollmien 240 Dec 30, 2022