internal/postgres: check units for package existence
Validate that a module has packages using module.Packages() instead of
module.LegacyPackages.
For golang/go#39629
Trust: Julie Qiu
Run-TryBot: Julie Qiu
TryBot-Result: kokoro
@@ -615,7 +615,7 @@ func validateModule(m *internal.Module) (err error) {
errReasons = append(errReasons, "invalid version")
}
}
- if len(m.LegacyPackages) == 0 {
+ if len(m.Packages()) == 0 {
errReasons = append(errReasons, "module does not have any packages")
}
if len(errReasons) != 0 {
