build: use packages.NeedImports (#91)

Use packages.NeedImports when loading packages. This fixes avo to account for a bugfix in golang/tools@aac0b97.

Closes #90
This commit is contained in:
Michael McLoughlin
2019-07-20 20:34:38 -07:00
committed by GitHub
parent cad456ebde
commit 8f97788836

View File

@@ -35,7 +35,7 @@ func NewContext() *Context {
// Package sets the package the generated file will belong to. Required to be able to reference types in the package.
func (c *Context) Package(path string) {
cfg := &packages.Config{
Mode: packages.NeedTypes | packages.NeedDeps,
Mode: packages.NeedTypes | packages.NeedDeps | packages.NeedImports,
}
pkgs, err := packages.Load(cfg, path)
if err != nil {