title: How to tell if folder exists and is writable?
body: <p>I'd like <code>func FolderExists(path string) bool</code> that will tell whether a folder exists and is writable. I've gotten here:</p>
  
  <pre><code>func FolderExists(path string) bool {
      info, err := os.Stat(path)
      return os.IsExist(err) &amp;&amp; info.Mode().IsDir() &amp;&amp; info.Mode().???
  }
  </code></pre>
  
  <p>How to tell if this folder is writable? I cannot simply check for filemode permissions (e.g. 0200 for user write permission) because then I'd have to check the owner of the file. Is there a straightforward way to do this in Go?</p>
  
  <p>For those with UNIX backgrounds, looking for the equivalent of the very simple:</p>
  
  <pre><code>if [ -d "$n" &amp;&amp; -w "$n" ] ; then ... fi
  </code></pre>