From 8f9778883698ee18d683ff2d650b587b0633c7d4 Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Sat, 20 Jul 2019 20:34:38 -0700 Subject: [PATCH] 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 --- build/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/context.go b/build/context.go index d1a1ec5..b537047 100644 --- a/build/context.go +++ b/build/context.go @@ -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 {