Mastering Concurrency in Go: Fan in With Channels (Part 2)

Part 1 , Part 2 , Part 3 , Part 4 , Part 5 Return values from go routines cannot be captured in the usual way with the = operator because starting a go routine is non blocking. A channel can be used to collect the results from many concurrent go routines. Write a value to a channel inside the go routine that is doing the work, then in main() read from the channel until it is closed to collect all the results from the go routines....

Mastering Concurrency in Go: With Fanout and Goroutines (Part 1)

Part 1 , Part 2 , Part 3 , Part 4 , Part 5 Goroutines can be used to take advantage of CPUs with multiple processors. Starting a Goroutine using the “go” keyword, will start execution on a thread in parallel if a thread is available. You will need to make sure that your main function does not exit before all the goroutines finish their work. Playground: https://go.dev/play/p/FTJLzwY34l2 package main import ( "fmt" "sync" ) func main() { wg := sync....

Become a More Effective Software Developer: 6 Key Techniques for Streamlining Your Workflow

Know When to NOT write code Writing code that is not useful is a waste of time. As software developers, writing code can seem like our only purpose and the only way to prove our value to the company. But way too often software is written only to be never used or thrown out. So you want to know exactly what you will be building and exactly how it will be useful....