Skip to content

Commit

Permalink
add concurrency to diff sniffing
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Nov 21, 2015
1 parent ca20873 commit 1a463d5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.go
Expand Up @@ -36,8 +36,15 @@ func main() {
fileName := fileDiff.NewName
hunks := fileDiff.GetHunks()

for _, hunk := range hunks {
err := hound.Sniff(fileName, hunk)
errs := make(chan error)
go func() {
for _, hunk := range hunks {
errs <- hound.Sniff(fileName, hunk)
}
close(errs)
}()

for err := range errs {
if err != nil {
fmt.Print(err)
os.Exit(1)
Expand Down

0 comments on commit 1a463d5

Please sign in to comment.