Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
esilva-everbridge committed May 25, 2018
1 parent d2f2369 commit f80e556
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ func processDir(searchDir string, fileExt string, action string) error {
// get a list of sls files along with the count
files, count := findFilesByExt(searchDir, fileExt)

// Copy files to a channel for workers to consume. Close the
// channel so that workers stop when all work is complete.
// copy files to a channel then close the
// channel so that workers stop when done
filesChan := make(chan string, count)
for _, file := range files {
filesChan <- file
Expand All @@ -476,7 +476,6 @@ func processDir(searchDir string, fileExt string, action string) error {
// run workers
for i := 0; i < count; i++ {
go func() {
// consume work from filesChan
for file := range filesChan {
resChan <- applyActionAndWrite(file, action, &pk, errChan)
}
Expand Down

0 comments on commit f80e556

Please sign in to comment.