闭包 是否是不同的goroutine Anonymous Functions 匿名函数

 

			go func() {
							r.log.Debug(utils.RuntimeInfo(), utils.MemStats())

							func() {
								<-time.After(L1L2ExpireDuration)
								if FaultUnhandled(FaultId) {
									err := EventCenterClient.ECClientSendEmail(FaultId, 12)
									if err != nil {
										r.log.Error(err, utils.RuntimeInfo())
									}
								}
							}()
							r.log.Debug(utils.RuntimeInfo(), utils.MemStats())

							func() {
								<-time.After(L2L3ExpireDuration)
								if FaultUnhandled(FaultId) {
									err := EventCenterClient.ECClientSendEmail(FaultId, 13)
									if err != nil {
										r.log.Error(err, utils.RuntimeInfo())
									}
								}
							}()
							r.log.Debug(utils.RuntimeInfo(), utils.MemStats())
						}()
					}

  

Closures in GoLang - GoLang Docs https://golangdocs.com/closures-in-golang

Anonymous Functions in GoLang - GoLang Docs https://golangdocs.com/anonymous-functions-in-golang

Closures in Golang - GeeksforGeeks https://www.geeksforgeeks.org/closures-in-golang/

 

posted @ 2022-05-19 17:56  papering  阅读(30)  评论(0编辑  收藏  举报