Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ExceptionHandler = func(err interface{}) { log.Panicln(err) }
ExceptionHandler 自定义的错误处理程序
Functions ¶
func Go ¶
func Go(f func())
Go 异步函数
Example ¶
package main import ( "fmt" "time" "github.com/hollson/gdk/async" ) func main() { async.ExceptionHandler = func(err interface{}) { fmt.Printf(" ❌ goroutine error: %v\n", err) } async.Go(func() { panic("some panic") }) time.Sleep(time.Second) }
Output: ❌ goroutine error: some panic
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.