code: func createDir(path string) error {
  	if _, err := os.Stat(path); err != nil {
  		if os.IsNotExist(err) {
  			if err = os.MkdirAll(path, 0755); err != nil {
  				return fmt.Errorf("Failed to create directory '%v': %v", path, err)
  			}
  		} else {
  			return fmt.Errorf("Failed to create directory '%v': %v", path, err)
  		}
  	}
  	return nil
  }
docs: // createDir method creates nested directories if not exists