aboutsummaryrefslogtreecommitdiff
path: root/src/archive
diff options
context:
space:
mode:
Diffstat (limited to 'src/archive')
-rw-r--r--src/archive/tar/reader_test.go2
-rw-r--r--src/archive/zip/zip_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/archive/tar/reader_test.go b/src/archive/tar/reader_test.go
index c7611ca044..5abbf3632e 100644
--- a/src/archive/tar/reader_test.go
+++ b/src/archive/tar/reader_test.go
@@ -791,7 +791,7 @@ func (rbs *readBadSeeker) Seek(int64, int) (int64, error) { return 0, fmt.Errorf
// that truncated files are still detected even if the underlying io.Reader
// satisfies io.Seeker.
func TestReadTruncation(t *testing.T) {
- var ss []string
+ ss := make([]string, 0, 4)
for _, p := range []string{
"testdata/gnu.tar",
"testdata/ustar-file-reg.tar",
diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go
index 5a6689a0eb..e891d26c10 100644
--- a/src/archive/zip/zip_test.go
+++ b/src/archive/zip/zip_test.go
@@ -240,8 +240,8 @@ func (r *rleBuffer) ReadAt(p []byte, off int64) (n int, err error) {
// Just testing the rleBuffer used in the Zip64 test above. Not used by the zip code.
func TestRLEBuffer(t *testing.T) {
b := new(rleBuffer)
- var all []byte
writes := []string{"abcdeee", "eeeeeee", "eeeefghaaiii"}
+ all := make([]byte, 0, len(writes)*len(writes[0]))
for _, w := range writes {
b.Write([]byte(w))
all = append(all, w...)