ch := make(chanint, runtime.NumCPU()) for i := 0; i < len(wechatOrderList); i++ { go modifyWxOrderProfit(&wechatOrderList[i], ch) ch <- i } close(ch) funcmodifyWxOrderProfit(wechatOrder *order.WechatOrder, ch chanint){ for v := range ch { fmt.Println("processing order", v) } }