Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Go ¶
func Go(fnc func())
Go run routine and add wait group.
Example ¶
package main import ( "fmt" "time" "gitoa.ru/go-4devs/closer/routine" ) func main() { defer routine.Close() routine.Go(func() { time.Sleep(time.Microsecond) fmt.Print("do some job") }) }
Output: do some job
func Run ¶
func Run(fnc ...func())
Run run routines and add wait group.
Example ¶
package main import ( "fmt" "time" "gitoa.ru/go-4devs/closer/routine" ) func main() { defer routine.Close() routine.Run(func() { time.Sleep(time.Microsecond) fmt.Print("do some job. ") }, func() { fmt.Print("fast job in goroutine. ") }) }
Output: fast job in goroutine. do some job.
Types ¶
Click to show internal directories.
Click to hide internal directories.