-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
func TimeoutCoder(f func(interface{}) error, e interface{}, msg string) error {
echan := make(chan error, 1)
go func() { echan <- f(e) }()
select {
case e := <-echan:
return e
case <-time.After(time.Minute):
return fmt.Errorf("Timeout %s", msg)
}
}
go func() { echan <- f(e) }(),this Goroutine leak。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels