summaryrefslogtreecommitdiff
path: root/src/pkg/archive
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-28 10:35:15 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-28 10:35:15 +0200
commitc1ba1a0fec4aed430709030f98a3bdb90bfeea16 (patch)
tree3df18657e50a0313ed6defcda30e4474cb28a467 /src/pkg/archive
parent7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (diff)
downloadgolang-c1ba1a0fec4aed430709030f98a3bdb90bfeea16.tar.gz
Imported Upstream version 2011.04.27upstream/2011.04.27
Diffstat (limited to 'src/pkg/archive')
-rw-r--r--src/pkg/archive/tar/common.go2
-rw-r--r--src/pkg/archive/tar/reader.go9
-rw-r--r--src/pkg/archive/zip/reader.go2
3 files changed, 4 insertions, 9 deletions
diff --git a/src/pkg/archive/tar/common.go b/src/pkg/archive/tar/common.go
index 5b781ff3d..528858765 100644
--- a/src/pkg/archive/tar/common.go
+++ b/src/pkg/archive/tar/common.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// The tar package implements access to tar archives.
+// Package tar implements access to tar archives.
// It aims to cover most of the variations, including those produced
// by GNU and BSD tars.
//
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 {
diff --git a/src/pkg/archive/zip/reader.go b/src/pkg/archive/zip/reader.go
index 0391d6441..17464c5d8 100644
--- a/src/pkg/archive/zip/reader.go
+++ b/src/pkg/archive/zip/reader.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
/*
-The zip package provides support for reading ZIP archives.
+Package zip provides support for reading ZIP archives.
See: http://www.pkware.com/documents/casestudies/APPNOTE.TXT