title: Can't get parser.ParseDir to parse Import statements
body: <p>I'm having trouble getting parser.ParseDir to return any information in the returned struct.Imports field.  parser.ParseFile does seem to work however.  I would much rather use ParseDir than have to go through and call ParseFile on each file.  Here's what I've tried:</p>
  
  <pre><code>package crawlers
  
  import (
    "fmt"
    "go/parser"
    "go/token"
    "os"
    "path/filepath"
  )
  
  type GoImports struct {
    //imports []*string
  }
  
  //returns fullpaths
  func (g *GoImports) Crawl(entry string) ([]*string, error) {
    fp, err := filepath.Abs(entry)
    if err != nil {
      return nil, err
    }
    info, err := os.Stat(fp)
    if err != nil {
      return nil, err
    }
    if !info.IsDir() {
      return nil, fmt.Errorf("Entry point should be a path to a directory of a go package.")
    }
    fset := token.NewFileSet()
    //foo, err := parser.ParseDir(fset, fp, nil, parser.ImportsOnly)
    //foo, err := parser.ParseDir(fset, "/Users/dowen00/local/go/src/got/crawlers/testdata/barpackage", nil, parser.ImportsOnly)
    foo, err := parser.ParseDir(fset, "/Users/dowen00/local/go/src/opscli", func(os.FileInfo) bool { return true }, parser.ImportsOnly)
    //_, err = parser.ParseDir(fset, "/Users/dowen00/local/go/src/got/crawlers/testdata", nil, parser.ImportsOnly)
    //foo, err := parser.ParseFile(fset, "/Users/dowen00/local/go/src/got/crawlers/testdata/barpackage/bar.go", nil, parser.ImportsOnly)
    if err != nil {
      return nil, err
    }
    //fmt.Printf("%c\n", foo)
    //fmt.Printf("%c\n", fset)
    for k, v := range foo {
      //for kv, vv := range v.Imports {
      //fmt.Printf("%s: %c\n", kv, vv)
      //}
      fmt.Printf("%s: %c\n", k, v.Imports)
    }
    return nil, nil
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>