Skip to content

Instantly share code, notes, and snippets.

@deathping1994
Last active January 20, 2017 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deathping1994/42ca1515c2243c7b4cb2d891b84a8f86 to your computer and use it in GitHub Desktop.
Save deathping1994/42ca1515c2243c7b4cb2d891b84a8f86 to your computer and use it in GitHub Desktop.
func ClearOldFolder(folder string) {
doneCh := make(chan struct{})
defer close(doneCh)
for object := range StorageClient.ListObjectsV2(StaticBucket, "gaurav-test", true, doneCh) {
if object.Err != nil {
fmt.Println(object.Err)
return
}
fmt.Println(object.Key)
err := StorageClient.RemoveObject(StaticBucket,object.Key)
PanicIf(err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment