sourcegraph/conc ? reverse-engineered prompt
Reverse engineered prompt
Build me a Go library for safer structured concurrency.
I want something that makes spawning goroutines feel clean and less risky, so I can use it instead of plain sync.WaitGroup and ad hoc go calls. It should help me run tasks in parallel with a limit on how many goroutines are active, collect results, handle errors nicely, and cancel work when one task fails. I also want support for processing slices concurrently, ordered streams with serial callbacks, and a way to catch panics from worker goroutines so they don’t crash the whole app without warning.
Please make the API easy to read and use from normal Go code, with simple helpers for common cases like waiting for work, mapping over a list, iterating in parallel, and running pools of tasks with results or errors. Keep the design focused on making it harder to leak goroutines and easier to understand what the concurrent code is doing. If you need to check current Go docs or best practices online, go ahead.
Are you gonna build this?
make sure you review the code using coderabbit