entc: drop deprecated packages.LoadSyntax usage (#1039)

This commit is contained in:
Alex Snast
2020-12-14 08:56:33 +02:00
committed by GitHub
parent d89ace2750
commit 29cd5f2750

View File

@@ -95,7 +95,9 @@ var entInterface = reflect.TypeOf(struct{ ent.Interface }{}).Field(0).Type
// load loads the schemas info.
func (c *Config) load() (string, error) {
pkgs, err := packages.Load(&packages.Config{Mode: packages.LoadSyntax}, c.Path, entInterface.PkgPath())
pkgs, err := packages.Load(&packages.Config{
Mode: packages.NeedName | packages.NeedTypes | packages.NeedTypesInfo,
}, c.Path, entInterface.PkgPath())
if err != nil {
return "", fmt.Errorf("loading package: %w", err)
}