code: func IsDir(path string) bool {
  	fi, err := os.Stat(path)
  	if err != nil {
  		if os.IsNotExist(err) {
  			// not found
  			return false
  		}
  		fmt.Printf("failed to check dir %s: %s\n", path, err)
  		return false
  	}
  
  	return fi.IsDir()
  }
docs: // IsDir checks if a certain path exists and is a directory
  // https://stackoverflow.com/questions/10510691/how-to-check-whether-a-file-or-directory-denoted-by-a-path-exists-in-golang