aboutsummaryrefslogtreecommitdiff
path: root/src/archive/tar/reader_test.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2024-10-26 00:48:33 +0700
committerShulhan <m.shulhan@gmail.com>2026-02-03 18:04:30 +0700
commit011e40da85bddf83fee0ded83cb9115b7a88b3d4 (patch)
tree355cc352e66fc64ce94f17658c31e699aa798bb1 /src/archive/tar/reader_test.go
parent85232e51b20971e0d211b25fa3aa412bc7987404 (diff)
downloadgo-011e40da85bddf83fee0ded83cb9115b7a88b3d4.tar.xz
all: prealloc slice with possible minimum capabilities
Diffstat (limited to 'src/archive/tar/reader_test.go')
-rw-r--r--src/archive/tar/reader_test.go2
1 files changed, 1 insertions, 1 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",