mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
12 lines
161 B
Go
12 lines
161 B
Go
|
package api
|
||
|
|
||
|
func runAsync(f func() error) <-chan error {
|
||
|
resp := make(chan error, 1)
|
||
|
go func() {
|
||
|
err := f()
|
||
|
resp <- err
|
||
|
close(resp)
|
||
|
}()
|
||
|
return resp
|
||
|
}
|