From 6f9cac13f390bdef065f65f358bbb1c57096b418 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 28 Apr 2017 17:04:47 +0100 Subject: [PATCH] No need for a buffer to decode CORK objects --- util/pack/pack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/pack/pack.go b/util/pack/pack.go index 6dc9daef..73e4108a 100644 --- a/util/pack/pack.go +++ b/util/pack/pack.go @@ -36,7 +36,7 @@ func Encode(src interface{}) (dst []byte) { // Decode decodes a CORK into a data object. func Decode(src []byte, dst interface{}) { - buf := bytes.NewBuffer(src) + buf := bytes.NewReader(src) cork.NewDecoder(buf).Options(&opt).Decode(dst) return }