summaryrefslogtreecommitdiff
path: root/src/pkg/archive/tar/reader.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/archive/tar/reader.go')
-rw-r--r--src/pkg/archive/tar/reader.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/pkg/archive/tar/reader.go b/src/pkg/archive/tar/reader.go
index 0cfdf355d..ad06b6dac 100644
--- a/src/pkg/archive/tar/reader.go
+++ b/src/pkg/archive/tar/reader.go
@@ -10,6 +10,7 @@ package tar
import (
"bytes"
"io"
+ "io/ioutil"
"os"
"strconv"
)
@@ -84,12 +85,6 @@ func (tr *Reader) octal(b []byte) int64 {
return int64(x)
}
-type ignoreWriter struct{}
-
-func (ignoreWriter) Write(b []byte) (n int, err os.Error) {
- return len(b), nil
-}
-
// Skip any unread bytes in the existing file entry, as well as any alignment padding.
func (tr *Reader) skipUnread() {
nr := tr.nb + tr.pad // number of bytes to skip
@@ -99,7 +94,7 @@ func (tr *Reader) skipUnread() {
return
}
}
- _, tr.err = io.Copyn(ignoreWriter{}, tr.r, nr)
+ _, tr.err = io.Copyn(ioutil.Discard, tr.r, nr)
}
func (tr *Reader) verifyChecksum(header []byte) bool {