Last active
June 2, 2019 20:25
-
-
Save philandstuff/21e48af16694be81799ae516a6d92fec to your computer and use it in GitHub Desktop.
Demonstration of ugorji/go#300
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/ugorji/go/codec" | |
) | |
func main() { | |
var h codec.CborHandle | |
h.SkipUnexpectedTags = true | |
toDecode := []byte{0xd9, 0xd9, 0xf7, 0x82, 0x61, 0x78, 0x00} | |
var raw interface{} | |
dec := codec.NewDecoderBytes(toDecode, &h) | |
err := dec.Decode(&raw) | |
if err != nil { | |
log.Fatal(err) | |
} | |
fmt.Printf("Got %#v from decoding", raw) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module gist.github.com/philandstuff/21e48af16694be81799ae516a6d92fec | |
go 1.12 | |
require github.com/ugorji/go v1.1.5-0.20190602185654-b7b8e1c6cca2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github.com/ugorji/go v1.1.5-0.20190602185654-b7b8e1c6cca2 h1:cq6ggwrtxk5VEWTVWlyl4E0XcOALX/DT3UcPtxX/MLk= | |
github.com/ugorji/go v1.1.5-0.20190602185654-b7b8e1c6cca2/go.mod h1:RaaajvHwnCbhlqWLTIB78hyPWp24YUXhQ3YXM7Hg7os= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment