MCPcopy Create free account
hub / github.com/mmcgrana/gobyexample / worker

Function worker

examples/waitgroups/waitgroups.go:13–19  ·  view source on GitHub ↗

This is the function we'll run in every goroutine.

(id int)

Source from the content-addressed store, hash-verified

11
12// This is the function we'll run in every goroutine.
13func worker(id int) {
14 fmt.Printf("Worker %d starting\n", id)
15
16 // Sleep to simulate an expensive task.
17 time.Sleep(time.Second)
18 fmt.Printf("Worker %d done\n", id)
19}
20
21func main() {
22

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected