code: func (p *fileParser) parsePackage(path string) error {
  	var pkgs map[string]*ast.Package
  	if imp, err := build.Import(path, p.srcDir, build.FindOnly); err != nil {
  		return err
  	} else if pkgs, err = parser.ParseDir(p.fileSet, imp.Dir, nil, 0); err != nil {
  		return err
  	}
  	for _, pkg := range pkgs {
  		file := ast.MergePackageFiles(pkg, ast.FilterFuncDuplicates|ast.FilterUnassociatedComments|ast.FilterImportDuplicates)
  		if _, ok := p.importedInterfaces[path]; !ok {
  			p.importedInterfaces[path] = make(map[string]*ast.InterfaceType)
  		}
  		for ni := range iterInterfaces(file) {
  			p.importedInterfaces[path][ni.name.Name] = ni.it
  		}
  		imports, _ := importsOfFile(file)
  		for pkgName, pkgPath := range imports {
  			if _, ok := p.imports[pkgName]; !ok {
  				p.imports[pkgName] = pkgPath
  			}
  		}
  	}
  	return nil
  }
docs: // parsePackage loads package specified by path, parses it and populates
  // corresponding imports and importedInterfaces into the fileParser.