entc/load: return errors from all loaded packages (#3243)

This commit is contained in:
Travis Cline
2023-01-16 00:59:49 -08:00
committed by GitHub
parent c5e08f20c1
commit cb320767c4

View File

@@ -120,6 +120,9 @@ func (c *Config) load() (*SchemaSpec, error) {
if len(pkg.Errors) != 0 {
return nil, pkg.Errors[0]
}
if len(entPkg.Errors) != 0 {
return nil, entPkg.Errors[0]
}
if pkgs[0].PkgPath != entInterface.PkgPath() {
entPkg, pkg = pkgs[1], pkgs[0]
}