Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collect ¶ added in v0.0.3
Example ¶
doWork := func(url string) chan error { errs := make(chan error) go func(url string) { // Some expensive work.. _, err := http.Get(url) if err != nil { errs <- err } }(url) return errs } for err := range Collect( doWork("1"), doWork("2"), ) { if err != nil { fmt.Println("Error:", err) } }
Output:
Types ¶
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
func NewSemaphore ¶
Click to show internal directories.
Click to hide internal directories.