func CreateTempDir(dir string, pattern string) string {
	dir, err := ioutil.TempDir(dir, pattern)
	if err != nil {
		logrus.Fatal(err)
	}
	return dir
}
CreateTempDir creates a new temporary directory in the directory dir.
The directory name is generated by taking pattern and applying a random string to the end
package helper
import (
	"io/ioutil"
	"os"
	"github.com/sirupsen/logrus"
)
func MkDirsIfNotExist(name string) bool {
	_, err := os.Stat(name)
	if os.IsNotExist(err) {
		logrus.Infof("creating directory %s", name)
		err = os.MkdirAll(name, os.ModePerm)
		if err != nil {
			logrus.Errorf("unable to create %s directory", name)
			return false
		}
		logrus.Infof("directory %s created", name)
		return true
	}
	return false
}
func CreateDirectoryNamedPath(path string) (string, error) {
	err := os.MkdirAll(path, os.ModePerm)
	if err != nil {
		logrus.Fatal("Unable to create directory (and its parents)", err)
	}
	return path, err
}