The chapter on channels in Concurrency in Go https://www.oreilly.com/library/view/concurrency-in-go/97814... is a must read for anyone looking to write concurrent code in Go. There are many "rules" you need to follow with channels to avoid shooting yourself in the foot that I haven't seen summarized in blog posts/official go docs