refactor(startup): 简化 WaitGroup 的使用方式
- 直接调用 Wait 方法而不再赋值给变量 - 减少不必要的中间变量声明 - 提高代码可读性与简洁性
This commit is contained in:
@@ -25,8 +25,7 @@ func createPipeline() pipeline.RequestPipeline {
|
||||
func Start() {
|
||||
results, err := services.Call(http.Serve, createPipeline())
|
||||
if err == nil {
|
||||
wg := results[0].(*sync.WaitGroup)
|
||||
wg.Wait()
|
||||
results[0].(*sync.WaitGroup).Wait()
|
||||
} else {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user