Skip to content

Instantly share code, notes, and snippets.

@clementlecorre
Created February 28, 2018 16:07
Show Gist options
  • Save clementlecorre/af59cd5c2976a12042587ae32e038ed6 to your computer and use it in GitHub Desktop.
Save clementlecorre/af59cd5c2976a12042587ae32e038ed6 to your computer and use it in GitHub Desktop.
Lazy directory removal with golang (ending with / signifies that it's a directory)
func RemoveDirectoryRecursively(dir string) error {
return os.RemoveAll(dir+"/")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment