command
Version:
v0.0.0-...-a2a1f02
Opens a new window with list of versions in this module.
Published: Dec 1, 2020
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
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.