code clean

This commit is contained in:
Li Jie
2024-09-07 10:20:02 +08:00
parent 75fe9d61a3
commit d2538d08a7
5 changed files with 20 additions and 28 deletions

View File

@@ -19,16 +19,7 @@
package async
var exec = &Executor{}
type Executor struct {
}
func Exec() *Executor {
return exec
}
func Run[T any](future Future[T]) (ret T) {
func Run[T any](future Future[T]) T {
ch := make(chan T)
go func() {
future(func(v T) {