worker_pool.go
Go•Expert
Explorer
C40
C++40
C#40
Dart40
Go
Beginner10
Intermediate10
Advanced10
Expert5
context_cancel.go
generic_func.go
worker_pool.go
sync_once.go
embed_interface.go
Master5
Java40
JavaScript40
Kotlin40
Objective-C40
Perl40
PHP40
Python40
R40
Ruby40
Rust40
Shell40
Swift40
TypeScript40
worker_pool.go
Click to focus
1
2
3
4
5
6
func worker(jobs <-chan int, results chan<- int, wg *sync.WaitGroup) {↵
defer wg.Done()↵
for j := range jobs {↵
results <- j * 2↵
}↵
}
0WPM•0%•0:00•0/145(0%)|Ln 1, Col 1
UTF-8•Go