title: Opening a File from a FileInfo
body: <p>In golang, if I have an <code>os.FileInfo</code>, is there any way to open an <code>*os.File</code> from that by itself without the original path?</p>
  
  <p>Let's say I had something like this:</p>
  
  <pre><code>package main
  
  import (
      "os"
      "path/filepath"
      "strings"
  )
  
  var files []os.FileInfo
  
  func walker(path string, info os.FileInfo, err error) error {
      if strings.HasSuffix(info.Name(), ".txt") {
          files = append(files, info)
      }
      return nil
  }
  
  func main() {
      err := filepath.Walk("/tmp/foo", walker)
      if err != nil {
          println("Error", err)
      } else {
          for _, f := range files {
              println(f.Name())
              // This is where we'd like to open the file
          }
      }
  }
  </code></pre>
  
  <p>Is there a way to convert <code>FileInfo</code> to <code>* File</code>? The code I'm actually working with isn't based on <code>filepath.Walk</code>; but I do get an <code>[]os.FileInfo</code> slice back. I still have the root directory, and the file name, but it seems like any further sub-tree information has gone by this stage. </p>