Skip to content

Commit

Permalink
Load packages with dependencies for Go 1.18
Browse files Browse the repository at this point in the history
Without the additional `NeedDeps` mockery fails with:
"Unexpected package creation during export data loading"

Refs #434
  • Loading branch information
emmanuel099 committed Mar 17, 2022
1 parent adda07f commit 4e181be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/parse.go
Expand Up @@ -37,7 +37,7 @@ type Parser struct {

func NewParser(buildTags []string) *Parser {
var conf packages.Config
conf.Mode = packages.LoadSyntax
conf.Mode = packages.LoadSyntax | packages.NeedDeps
if len(buildTags) > 0 {
conf.BuildFlags = []string{"-tags", strings.Join(buildTags, ",")}
}
Expand Down

0 comments on commit 4e181be

Please sign in to comment.