build: load package in LoadAllSyntax mode (#63)

Fixes #62
This commit is contained in:
Michael McLoughlin
2019-02-20 21:17:28 +00:00
committed by GitHub
parent 9eb409b935
commit 3cfe40e76c
5 changed files with 36 additions and 1 deletions

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.LoadTypes,
Mode: packages.LoadAllSyntax,
}
pkgs, err := packages.Load(cfg, path)
if err != nil {