GOLANGPROFI Telegram 559
Что выведет код ?

package main

import (
"fmt"
)

func printChannel(ch chan int) {
for {
select {
case num := <-ch:
fmt.Printf("%d ", num)

}
}
}

func main() {
ch := make(chan int)
go printChannel(ch)
for i := 0; i < 5; i++ {
ch <- i
}

}


Ответ



tgoop.com/golangprofi/559
Create:
Last Update:

Что выведет код ?

package main

import (
"fmt"
)

func printChannel(ch chan int) {
for {
select {
case num := <-ch:
fmt.Printf("%d ", num)

}
}
}

func main() {
ch := make(chan int)
go printChannel(ch)
for i := 0; i < 5; i++ {
ch <- i
}

}


Ответ

BY Golang Юниор


Share with your friend now:
tgoop.com/golangprofi/559

View MORE
Open in Telegram


Telegram News

Date: |

Although some crypto traders have moved toward screaming as a coping mechanism, several mental health experts call this therapy a pseudoscience. The crypto community finds its way to engage in one or the other way and share its feelings with other fellow members. Step-by-step tutorial on desktop: Telegram users themselves will be able to flag and report potentially false content. Activate up to 20 bots How to create a business channel on Telegram? (Tutorial)
from us


Telegram Golang Юниор
FROM American