No need for a buffer to decode CORK objects

This commit is contained in:
Tobie Morgan Hitchcock 2017-04-28 17:04:47 +01:00
parent 862df0c9e3
commit 6f9cac13f3

View file

@ -36,7 +36,7 @@ func Encode(src interface{}) (dst []byte) {
// Decode decodes a CORK into a data object. // Decode decodes a CORK into a data object.
func Decode(src []byte, dst interface{}) { func Decode(src []byte, dst interface{}) {
buf := bytes.NewBuffer(src) buf := bytes.NewReader(src)
cork.NewDecoder(buf).Options(&opt).Decode(dst) cork.NewDecoder(buf).Options(&opt).Decode(dst)
return return
} }