Created
September 16, 2016 05:18
-
-
Save macalinao/5372b750810f8aacaa82f200d19f1dec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create aggregate sum | |
sum := (*apb.MatchSum)(nil) | |
go func() { | |
for sumRow := range sumsChan { | |
if sum == nil { | |
sum = &apb.MatchSum{} | |
} | |
sum = addMatchSums(sum, sumRow) | |
} | |
}() | |
// Terminate when all sums are fetched | |
wg.Wait() | |
close(sumsChan) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment