GOLANG_INTERVIEW Telegram 1217
👣 Что выведет код ?



package main

func oneStep(yield func() bool) {
yield()
}

func f() {
for range oneStep {
print("f ")
recover()
}
}

func g() {
for range 1 {
print("g ")
recover()
}
}

func checkPanic(loop func(), c chan<- struct{}) {
defer func() {
println(recover() != nil)
c <- struct{}{}
}()
defer loop()
panic(123)
}

func main() {
c := make(chan struct{}, 1)
go checkPanic(f, c)
<-c
go checkPanic(g, c)
<-c
}




🔗 Ответ

@golang_interview
Please open Telegram to view this post
VIEW IN TELEGRAM
3👍2



tgoop.com/golang_interview/1217
Create:
Last Update:

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



package main

func oneStep(yield func() bool) {
yield()
}

func f() {
for range oneStep {
print("f ")
recover()
}
}

func g() {
for range 1 {
print("g ")
recover()
}
}

func checkPanic(loop func(), c chan<- struct{}) {
defer func() {
println(recover() != nil)
c <- struct{}{}
}()
defer loop()
panic(123)
}

func main() {
c := make(chan struct{}, 1)
go checkPanic(f, c)
<-c
go checkPanic(g, c)
<-c
}




🔗 Ответ

@golang_interview

BY Golang вопросы собеседований


Share with your friend now:
tgoop.com/golang_interview/1217

View MORE
Open in Telegram


Telegram News

Date: |

Commenting about the court's concerns about the spread of false information related to the elections, Minister Fachin noted Brazil is "facing circumstances that could put Brazil's democracy at risk." During the meeting, the information technology secretary at the TSE, Julio Valente, put forward a list of requests the court believes will disinformation. The administrator of a telegram group, "Suck Channel," was sentenced to six years and six months in prison for seven counts of incitement yesterday. But a Telegram statement also said: "Any requests related to political censorship or limiting human rights such as the rights to free speech or assembly are not and will not be considered." Telegram has announced a number of measures aiming to tackle the spread of disinformation through its platform in Brazil. These features are part of an agreement between the platform and the country's authorities ahead of the elections in October. 4How to customize a Telegram channel?
from us


Telegram Golang вопросы собеседований
FROM American