Actually allocate result arrays

This commit is contained in:
Eli Ribble 2026-05-16 18:11:44 +00:00
parent 61580f31b2
commit feff03428f
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View file

@ -39,6 +39,7 @@ func ContactEmailByContactIDs(ctx context.Context, txn db.Ex, contact_ids []int6
if err != nil {
return result, fmt.Errorf("query by contact IDs: %w", err)
}
result = make(map[int64][]model.ContactEmail, len(contact_ids))
for _, contact_id := range contact_ids {
result[contact_id] = make([]model.ContactEmail, 0)
}

View file

@ -60,6 +60,7 @@ func ContactPhoneByContactIDs(ctx context.Context, txn db.Ex, contact_ids []int6
if err != nil {
return result, fmt.Errorf("query by contact IDs: %w", err)
}
result = make(map[int64][]model.ContactPhone, len(contact_ids))
for _, contact_id := range contact_ids {
result[contact_id] = make([]model.ContactPhone, 0)
}