Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
shvc committed May 7, 2023
1 parent 093caf8 commit 6d79a7d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions s3cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -1322,9 +1322,10 @@ func (sc *S3Cli) deletePrefix(ctx context.Context, bucket, prefix string) error
if sc.verboseOutput() {
fmt.Printf("Got %d Objects, ", objectNum)
}
objects := make([]*s3.ObjectIdentifier, 0, 1000)
for _, obj := range resp.Contents {
objects = append(objects, &s3.ObjectIdentifier{Key: obj.Key})

objects := make([]*s3.ObjectIdentifier, objectNum)
for i, obj := range resp.Contents {
objects[i] = &s3.ObjectIdentifier{Key: obj.Key}
}
doi := &s3.DeleteObjectsInput{
Bucket: aws.String(bucket),
Expand Down

0 comments on commit 6d79a7d

Please sign in to comment.