Tech
The Goroutine Awakens: Mastering Go Concurrency Like a Jedi
The Quest Begins (The “Why”)
I still remember the first time I tried to make a Go program talk to itself. I had a simple web scraper that needed to fetch a dozen URLs, parse the HTML, and dump the results into a CSV. My first attempt looked like this:
func main () {
urls := [] string { /* … */ }
results := make ( chan string , len ( urls ))
for _ , u := range urls {
go fetch ( u , results ) // fire off ...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to