Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/goinaction/code
/ printer
Function
printer
chapter1/channels/hellochannels.go:10–15 ·
view source on GitHub ↗
(ch chan int)
Source
from the content-addressed store, hash-verified
8
var
wg sync.WaitGroup
9
10
func
printer(ch
chan
int) {
11
for
i :=
range
ch {
12
fmt.Printf(
"Received %d "
, i)
13
}
14
wg.Done()
15
}
16
17
// main is the entry point for the program.
18
func
main() {
Callers
1
main
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected