|Goroutines & Closures||Important caveat on shadowing variable in loops included|
|Using uiprogress||Notes I wrote about trying threadsafe progress bar package|
Running CLI tools via goroutines can speed up slow actions like code generation. I prefer to run these types of actions with a buffered channel to throttle the requests and avoid overloading my laptop. 🔥
Here’s an example using Pterm output for reporting progress (no progress bar)1.
Since things are running concurrently, a single bar isn’t quite accurate. There are libraries that report correctly with goroutines, but as of 2023-03, pterm isn’t one of them. However, it’s under development. ↩︎