Skip to content

Commit

Permalink
Add missing doneCh in the example for removeobjects (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
oivoodoo authored and nitisht committed Mar 26, 2018
1 parent 1323d20 commit c405bbc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/s3/removeobjects.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func main() {
// Send object names that are needed to be removed to objectsCh
go func() {
defer close(objectsCh)

doneCh := make(chan struct{})

// Indicate to our routine to exit cleanly upon return.
defer close(doneCh)

// List all objects from a bucket-name with a matching prefix.
for object := range s3Client.ListObjects("my-bucketname", "my-prefixname", true, doneCh) {
if object.Err != nil {
Expand Down

0 comments on commit c405bbc

Please sign in to comment.