Last active
January 20, 2017 10:39
-
-
Save deathping1994/42ca1515c2243c7b4cb2d891b84a8f86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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