摘要:
官方示例 package main import ( "fmt" "github.com/panjf2000/ants/v2" "sync" "sync/atomic" "time" ) var sum int32 func myFunc(i interface{}) { n := i.(int32 阅读全文
摘要:
package main import ( "fmt" "sync" ) type Task struct { f func() error } var wg sync.WaitGroup type Pool struct { //任务通道 JobQueue chan Task //worker通道 阅读全文