archive/tar: cleaner reset

This commit is contained in:
Vincent Batts 2015-02-20 14:49:23 -05:00
parent 43b7a5effb
commit 50168a6bb3
1 changed files with 2 additions and 4 deletions

View File

@ -52,10 +52,8 @@ func (tr *Reader) RawBytes() []byte {
if tr.rawBytes == nil { if tr.rawBytes == nil {
tr.rawBytes = bytes.NewBuffer(nil) tr.rawBytes = bytes.NewBuffer(nil)
} }
defer func() { // if we've read them, then flush them.
// if we've read them, then flush them. defer tr.rawBytes.Reset()
tr.rawBytes.Reset()
}()
return tr.rawBytes.Bytes() return tr.rawBytes.Bytes()
} }