Hi, I'm working on some codegen logic which uses a file's AST to generate 
some functions. I want to find the zero values of certain identifier types, 
and to do this, I need underlying types of these indentifiers. 
So I use go's type checker, however it takes a very long time for it to 
completely type-check a package (a comparatively large package as compared 
to other packages in the source code). The whole source code takes about 
30s to build but about 1 minute to type-check a large package.

I'm using the importer which loads the program from source:

conf := types.Config{Importer: importer.ForCompiler(fset, "source", nil)}
info := &types.Info{
    Uses: make(map[*ast.Ident]types.Object),
}
_, err := conf.Check(pkgPath, fset, fileAST, info)

Seems like I'm missing something here. Any help would be great!
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e9583620-3569-4cce-b725-75481b28b8f3n%40googlegroups.com.

Reply via email to