On Friday, 17 June 2016 15:21:55 UTC-4, Joshua Liebow-Feeser wrote:
>
> Hi All,
>
> I'm trying to use the go/* packages to parse and type check Go source 
> code. I've downloaded github.com/coreos/etcd to test this on, and I'm 
> currently trying it out in the etcdserver subdirectory. When I run 'go 
> build' everything works fine, but when I try to type check, none of the 
> imports are found.
>

Try running 'go install' or 'go build -i' on the packages you want to 
analyze.

The default importer works great for packages in the standard 
library, which are always available in compiled form, but poorly for user 
packages, for which it may have been days or weeks since the most recent 
install.  Take a look at the golang.org/x/tools/go/loader package, 
which loads all packages from source.

Also, you may find this tutorial helpful: 
https://github.com/golang/example/tree/master/gotypes

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to