Skip to content

Instantly share code, notes, and snippets.

@cormacrelf
Created January 20, 2014 15:09
Show Gist options
  • Save cormacrelf/8521560 to your computer and use it in GitHub Desktop.
Save cormacrelf/8521560 to your computer and use it in GitHub Desktop.
// format: [dest: msg, dest2: msg2]
acc := make(map[string][]string, len(args.recipients))
for _, r := range args.recipients {
remote := dealers[r]
remote.SendMessage(args.msg)
}
for _, r := range args.recipients {
remote := dealers[r]
msg, err := remote.RecvMessage(0)
if err == nil {
acc[r] = msg
}
}
*args.res <- acc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment