Go has several useful functions for working with directories in the file system.
You learn in this page how to create an empty folder and how to delete an existing folder using Go.
To create an empty folder using go use the function Mkdir() from os package
To delete an existing folder using go use the function RemoveAll() from os package
Example of creating new folder and delete a folder using Go
In this page (written and validated by A. Gawali) you learned about Go Directories - create - delete . What's Next? If you are interested in completing Go tutorial, your next topic will be learning about: Go Date Time.
Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: email@example.com.