I\'m new to Go and can\'t seem to find a way to delete all the contents of a directory when I don\'t know the contents.
I\'ve tried:
os.RemoveAll(\"/tmp/
func RemoveContents(dir string) error { files, err := filepath.Glob(filepath.Join(dir, "*")) if err != nil { return err } for _, file := range files { err = os.RemoveAll(file) if err != nil { return err } } return nil }