mirror of
https://github.com/distribution/distribution.git
synced 2025-09-15 22:59:24 +00:00
Preallocate created slice in S3 tests
In case drvr.PutContent fails and returns error we'd have some extra memory allocated, though in this case (test with known size of the slice being iterated), that's fine. Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
@@ -500,8 +500,7 @@ func TestWalk(t *testing.T) {
|
||||
}
|
||||
|
||||
// create file structure matching fileset above
|
||||
// nolint:prealloc
|
||||
var created []string
|
||||
created := make([]string, 0, len(fileset))
|
||||
for _, p := range fileset {
|
||||
err := drvr.PutContent(context.Background(), p, []byte("content "+p))
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user