We need to fight go/packages a bit to find the right package to use for
type information (see golang/go#27910 for more
details).
Also, our logic for surfacing embedded fields where the embedded type
had a valid go/types.Type was incorrect. It assumed that all such types
must be external to the package being generated, and hence required that
all fields be exported. However, it is possible for a package-local type
to fully type check and therefore be valid. In this case, non-exported
fields are valid for surfacing.
Also a small fix in cmd/gg whereby xtest packages were incorrectly being
considered as not Done() because they were missing a hash (which they
will never have). Added a failsafe that errors in case any work was left
un-Done
We need to fight go/packages a bit to find the right package to use for type information (see golang/go#27910 for more details).
Also, our logic for surfacing embedded fields where the embedded type had a valid go/types.Type was incorrect. It assumed that all such types must be external to the package being generated, and hence required that all fields be exported. However, it is possible for a package-local type to fully type check and therefore be valid. In this case, non-exported fields are valid for surfacing.
Also a small fix in cmd/gg whereby xtest packages were incorrectly being considered as not Done() because they were missing a hash (which they will never have). Added a failsafe that errors in case any work was left un-Done