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.

Playground: https://go.dev/play/p/_7WZdef4q4W

part 2