errgroup

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrGroup

type ErrGroup struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ErrGroup is a group of functions that will exit on first error

func New

func New() *ErrGroup

New creeats a new errgroup

func (*ErrGroup) Go

func (g *ErrGroup) Go(f func() error)

Go calls the given function in a new goroutine. must not be called after wait is called

func (*ErrGroup) Wait

func (g *ErrGroup) Wait() error

Wait returns on first error or when all functions finish. On error, it does not wait for the other functions, so this should only be used if the program will exit.

Jump to

Keyboard shortcuts

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