I'm Bad at Concurrency in Go

Recently, I came across a hypothetical Go concurrency problem. It’s a simple, toy problem that’s a potentially useful thought experiment for solving real-world problems. It’s also interesting because it has potential opportunity to be built on and improved. The problem goes like this, given: type Point struct { // Stuff, doesn't matter } func ExpensiveServiceCall(point Point) bool { // Really expensive call to remote service } func ScatterShot(points []Point) bool { // Implement me } you’re suppose to implement ScatterShot(point []Point) bool which returns true when one of the points “hits”, that is, when a call toExpensiveServiceCall(point Point) bool returns true....

January 23, 2023 · 8 min · Mike