Skip to content

Instantly share code, notes, and snippets.

@methane
Last active February 7, 2024 15:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save methane/cfdcce8257a6406dd2ad to your computer and use it in GitHub Desktop.
Save methane/cfdcce8257a6406dd2ad to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/ugorji/go/codec"
)
var mh = codec.MsgpackHandle{}
func main() {
mh.SignedInteger = false
data := []byte{0x2a}
dec := codec.NewDecoderBytes(data, &mh)
var dd interface{}
dec.MustDecode(&dd)
fmt.Printf("%+v, %T\n", dd, dd)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment