command
Version:
v0.0.0-...-cf25b83
Opens a new window with list of versions in this module.
Published: Dec 22, 2021
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
goroutines-waitgroup example
Concurrency using a waitgroup (waiting for a collection of goroutines to finish).
These are my 5 main example of using goroutines,
GitHub Webpage
WAITGROUP
A WaitGroup allows to wait for a collection of goroutines to finish.
First make a waitgroup,
var wg sync.WaitGroup
- wg.Add(1) - Add the goroutines to the waitgroup
- wg.Done() - Call done when goroutine finished
- wg.Wait() - Wait for all the the waitgroups are done
![IMAGE - goroutines-waitgroup - IMAGE](https://github.com/jeffdecola/my-go-examples/raw/cf25b83a9fbf/erase/docs/pics/goroutines/goroutines-waitgroup.jpg)
RUN
go run goroutines_waitgroup.go
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.