syncutil

package
v0.101.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaitGroup

type WaitGroup struct {
	// contains filtered or unexported fields
}

WaitGroup is a custom sync.WaitGroup that handles functions that return errors.

func (*WaitGroup) Do

func (wg *WaitGroup) Do(fn func() error)

Do starts a new goroutine and executes the function within that goroutine. This will not execute the function if an error has already occurred.

func (*WaitGroup) Wait

func (wg *WaitGroup) Wait() error

Wait waits for all of the goroutines started with Do to finish. It returns the first error encountered, but will wait for the remaining goroutines to finish.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL