How to remove all contents of a directory using Golang? January 17, 2023 by Tarik Simply do: os.RemoveAll("/tmp/") os.MkdirAll("/tmp/",FileMode)