You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"testing"
"github.com/ugorji/go/codec"
)
type V struct {
A int `codec:"a"`
B *int `codec:"b,omitempty"`
C int `codec:"c,omitempty"`
}
func TestPacketEncode(t *testing.T) {
var v V
var mh codec.MsgpackHandle
var encoded []byte
e := codec.NewEncoderBytes(&encoded, &mh)
err := e.Encode(v)
if err != nil {
t.Fatal(err)
}
t.Logf("Encoded to %#v", encoded)
if encoded[0] != 0x81 {
t.Fatalf("Expected first byte of %#v to be 0x81", encoded)
}
}
prints:
go test .
--- FAIL: TestPacketEncode (0.00s)
msgpack_test.go:25: Encoded to []byte{0x82, 0xa1, 0x61, 0x0, 0xa1, 0x62, 0xc0}
msgpack_test.go:27: Expected first byte of []byte{0x82, 0xa1, 0x61, 0x0, 0xa1, 0x62, 0xc0} to be 0x81
FAIL
on master and v1.1.
I'll see if I can bisect it...
The text was updated successfully, but these errors were encountered:
Repro test:
prints:
on master and v1.1.
I'll see if I can bisect it...
The text was updated successfully, but these errors were encountered: