Actually allocate result arrays
This commit is contained in:
parent
61580f31b2
commit
feff03428f
2 changed files with 2 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ func ContactEmailByContactIDs(ctx context.Context, txn db.Ex, contact_ids []int6
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("query by contact IDs: %w", err)
|
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 {
|
for _, contact_id := range contact_ids {
|
||||||
result[contact_id] = make([]model.ContactEmail, 0)
|
result[contact_id] = make([]model.ContactEmail, 0)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ func ContactPhoneByContactIDs(ctx context.Context, txn db.Ex, contact_ids []int6
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, fmt.Errorf("query by contact IDs: %w", err)
|
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 {
|
for _, contact_id := range contact_ids {
|
||||||
result[contact_id] = make([]model.ContactPhone, 0)
|
result[contact_id] = make([]model.ContactPhone, 0)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue