forked from TrueCloudLab/distribution
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:
parent
a9d31ec7b9
commit
1089800643
1 changed files with 1 additions and 2 deletions
|
@ -500,8 +500,7 @@ func TestWalk(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create file structure matching fileset above
|
// create file structure matching fileset above
|
||||||
// nolint:prealloc
|
created := make([]string, 0, len(fileset))
|
||||||
var created []string
|
|
||||||
for _, p := range fileset {
|
for _, p := range fileset {
|
||||||
err := drvr.PutContent(context.Background(), p, []byte("content "+p))
|
err := drvr.PutContent(context.Background(), p, []byte("content "+p))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue