Skip to content
Snippets Groups Projects
Commit 73a378ff authored by Jonah Husson's avatar Jonah Husson
Browse files

Mr comment fixes

parent 25e515f2
No related branches found
No related tags found
2 merge requests!510Release,!382Xx 4184/multilookup
......@@ -514,14 +514,15 @@ func MultiLookupUD(e2eID int, udContact []byte, cb UdMultiLookupCallback,
}
go func() {
var contactList []contact.Contact
marshaledContactList := make([][]byte, 0)
var failedIDs []*id.ID
var errorString string
for numReturned := 0; numReturned < len(idList); numReturned++ {
response := <-respCh
if response.err != nil {
failedIDs = append(failedIDs, response.id)
contactList = append(contactList, response.contact)
marshaledContactList = append(
marshaledContactList, response.contact.Marshal())
} else {
errorString = errorString +
fmt.Sprintf("Failed to lookup id %s: %+v",
......@@ -536,16 +537,10 @@ func MultiLookupUD(e2eID int, udContact []byte, cb UdMultiLookupCallback,
"Failed to marshal failed IDs"))
}
marshaledContactList := make([][]byte, 0)
for _, con := range contactList {
marshaledContactList = append(
marshaledContactList, con.Marshal())
}
contactListJSON, err2 := json.Marshal(marshaledContactList)
if err2 != nil {
contactListJSON, err := json.Marshal(marshaledContactList)
if err != nil {
jww.FATAL.Panicf(
"Failed to marshal list of contact.Contact: %+v", err2)
"Failed to marshal list of contact.Contact: %+v", err)
}
cb.Callback(contactListJSON, marshalledFailedIds, errors.New(errorString))
}()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment