-
-
Save chouaibhm/a21e071567ccd7e33cf43a07f0f7ee32 to your computer and use it in GitHub Desktop.
Revisions
-
hahwul created this gist
Jan 22, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ package main import ( "fmt" "strconv" "sync" ) func main() { fmt.Println("vim-go") wordlists := make(chan string) // Scanning concurrency := 10 var wg sync.WaitGroup for i := 0; i < concurrency; i++ { wg.Add(1) go func() { for word := range wordlists { fmt.Println(word) } wg.Done() }() } for j := 0; j < 100; j++ { wordlists <- strconv.Itoa(j) } close(wordlists) wg.Wait() }