MCPcopy
hub / github.com/mao888/golang-guide / main

Function main

golang/go-study/go语言基础/并发/exercise/计算int64随机数各位数和.go:41–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39}
40
41func main() {
42 jobChain := createRandNumber()
43
44 resultChain := make(chan int, 100)
45 for i := 0; i < 24; i++ {
46 wg.Add(1)
47 go receiveJobChain(jobChain, resultChain)
48 }
49
50 go func() {
51 wg.Wait()
52 close(resultChain)
53 }()
54
55 for v := range resultChain {
56 fmt.Println(v)
57 }
58}

Callers

nothing calls this directly

Calls 4

createRandNumberFunction · 0.85
receiveJobChainFunction · 0.85
AddMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected