增加初始化等待

This commit is contained in:
fumiama
2022-01-31 00:39:39 +08:00
parent 0770c6e4a1
commit ca18a323e3
19 changed files with 50 additions and 12 deletions

14
order/init.go Normal file
View File

@@ -0,0 +1,14 @@
package order
import "sync"
var wg sync.WaitGroup
// DoneOnExit 在退出时执行 Done
func DoneOnExit() func() {
wg.Add(1)
return wg.Done
}
// Wait 等待
var Wait = wg.Wait