code: func parsePackageSource(pkg string) (*types.Scope, *doc.Package, error) {
  	pd, err := build.Import(pkg, ".", 0)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	fset := token.NewFileSet()
  	files := make(map[string]*ast.File)
  	fileList := make([]*ast.File, len(pd.GoFiles))
  	for i, fname := range pd.GoFiles {
  		src, err := ioutil.ReadFile(path.Join(pd.SrcRoot, pd.ImportPath, fname))
  		if err != nil {
  			return nil, nil, err
  		}
  		f, err := parser.ParseFile(fset, fname, src, parser.ParseComments|parser.AllErrors)
  		if err != nil {
  			return nil, nil, err
  		}
  		files[fname] = f
  		fileList[i] = f
  	}
  
  	cfg := types.Config{
  		Importer: importer.Default(),
  	}
  	info := types.Info{
  		Defs: make(map[*ast.Ident]types.Object),
  	}
  	tp, err := cfg.Check(pkg, fset, fileList, &info)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	scope := tp.Scope()
  
  	ap, _ := ast.NewPackage(fset, files, nil, nil)
  	docs := doc.New(ap, pkg, 0)
  
  	return scope, docs, nil
  }
docs: // parsePackageSource returns the types scope and the package documentation from the package