Pargo
Generic concurrent collection processing for Go.

Pargo helps you process collections concurrently without writing goroutines, channels, or sync.WaitGroup.
Designed for modern Go, Pargo uses generics, context propagation, and a simple API to make parallel processing predictable, readable, and production-ready.
Why Pargo?
Go provides excellent concurrency primitives, but processing collections in parallel still requires repetitive boilerplate.
Instead of writing this:
jobs := make(chan User)
results := make(chan Profile)
var wg sync.WaitGroup
for i := 0; i < workers; i++ {
go worker(...)
}
You'll write:
profiles, err := pargo.Map(
ctx,
users,
fetchProfile,
)
Cleaner.
Safer.
Easier to maintain.
Features
- Generic API using Go generics
- Context-aware operations
- Configurable worker pool
- Ordered results by default
- Functional options
- Panic recovery
- Zero external runtime dependencies
- High-performance concurrent execution
Installation
go get github.com/mohammedimrankasab/pargo
Roadmap
| Version |
Features |
| v0.1 |
Parallel Map, worker pool, ordered results, context cancellation |
| v0.2 |
Parallel Filter |
| v0.3 |
Collection pipelines |
| v0.4 |
Batch processing |
| v0.5 |
Retry support |
| v0.6 |
Streaming collections |
| v1.0 |
Stable public API |
Design Principles
Pargo follows a few simple principles:
- Idiomatic Go
- Generics first
- Context everywhere
- Functional options
- Zero external dependencies
- Predictable behavior
- High test coverage
- Backward compatibility after v1.0
Examples
Basic usage
Map
output, err := pargo.Map(
ctx,
input,
func(ctx context.Context, idx int, value int) (int, error) {
return value * 2, nil
},
)
output, err := pargo.Map(
ctx,
input,
mapper,
pargo.WithWorkers(4),
)
Filter
result, err := pargo.Filter(
ctx,
numbers,
func(ctx context.Context, idx, value int) (bool, error) {
return value%2 == 0, nil
},
pargo.WithWorkers(4),
)
Project Status
🚧 Early Development
Pargo is currently under active development.
The API is still evolving before the first stable release (v1.0.0). Feedback, ideas, bug reports, and contributions are welcome.
Contributing
Please read CONTRIBUTING.md before opening a pull request.
License
Released under the MIT License.