1 Star 0 Fork 0

yuliang87 / websocket

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
go.go 384 Bytes
一键复制 编辑 原始数据 按行查看 历史
yuliang87 提交于 2021-09-05 13:50 . 1
package xsync
import (
"fmt"
)
// Go allows running a function in another goroutine
// and waiting for its error.
func Go(fn func() error) <-chan error {
errs := make(chan error, 1)
go func() {
defer func() {
r := recover()
if r != nil {
select {
case errs <- fmt.Errorf("panic in go fn: %v", r):
default:
}
}
}()
errs <- fn()
}()
return errs
}
1
https://gitee.com/yuliang_team/websocket.git
git@gitee.com:yuliang_team/websocket.git
yuliang_team
websocket
websocket
64f9d9db21fb

搜索帮助

53164aa7 5694891 3bd8fe86 5694891