code: func CreateIfNotExists(path string, isDir bool) error {
  	if _, err := os.Stat(path); err != nil {
  		if os.IsNotExist(err) {
  			if isDir {
  				return os.MkdirAll(path, 0755)
  			}
  			if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
  				return err
  			}
  			f, err := os.OpenFile(path, os.O_CREATE, 0755)
  			if err != nil {
  				return err
  			}
  			f.Close()
  		}
  	}
  	return nil
  }
docs: // CreateIfNotExists creates a file or a directory only if it does not already exist.