@@ -25,7 +25,7 @@ func Rule(shareVars *sync.Map) {
}
}()
// 1 使用goroutine
- go func() {
+ go func(shareVars *sync.Map) {
// 2 定义触发器的间隔时间
ticker := time.NewTicker(time.Duration(4) * time.Second)
defer ticker.Stop()
@@ -40,5 +40,5 @@ func Rule(shareVars *sync.Map) {
- }()
+ }(shareVars)