exercism / exercism/exalysis

parallel-letter-frequency: false positive on 'wait for goroutines'

Open
#74 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
33
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Solution [7ae34b6188784d06a7fd50faa6872bba](https://exercism.io/mentor/solutions/7ae34b6188784d06a7fd50faa6872bba) is fine:

```go
func ConcurrentFrequency(strings []string) FreqMap {
results := make(chan FreqMap)
m := FreqMap{}
for _, currentString := range strings {
go func(text string) {
results <- Frequency(text)
}(currentString)
}
for range strings {
for k, v := range <-results {
m[k] += v
}
}
return m
}
```

but Exalysis thinks it's waiting for the goroutines to be done [most definitely my fault]:

```
Here is one thought for further improvement:
- It looks like you wait until all results have been received from the goroutines before starting to merge them. In fact, you can (and should) start processing as soon as you receive the first result.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.