title: Golang Determining whether *File points to file or directory
body: <p>Is there a way to determine whether my *File is pointing to a file or a directory?</p>
  
  <pre><code>fileOrDir, err := os.Open(name)
  // How do I know whether I have a file or directory?
  </code></pre>
  
  <p>I want to be able to read stats about the file if it is just a file, and be able to read the files within the directory if it is a directory</p>
  
  <pre><code>fileOrDir.Readdirnames(0) // If dir
  os.Stat(name) // If file
  </code></pre>