From 50168a6bb38cb2ec0f21ba5dd9dd3ae24e28b852 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 20 Feb 2015 14:49:23 -0500 Subject: [PATCH] archive/tar: cleaner reset --- archive/tar/reader.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/archive/tar/reader.go b/archive/tar/reader.go index c0e5795..a89957e 100644 --- a/archive/tar/reader.go +++ b/archive/tar/reader.go @@ -52,10 +52,8 @@ func (tr *Reader) RawBytes() []byte { if tr.rawBytes == nil { tr.rawBytes = bytes.NewBuffer(nil) } - defer func() { - // if we've read them, then flush them. - tr.rawBytes.Reset() - }() + // if we've read them, then flush them. + defer tr.rawBytes.Reset() return tr.rawBytes.Bytes() }