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🤔1



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: |

Over 33,000 people sent out over 1,000 doxxing messages in the group. Although the administrators tried to delete all of the messages, the posting speed was far too much for them to keep up. In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. With Bitcoin down 30% in the past week, some crypto traders have taken to Telegram to “voice” their feelings. Invite up to 200 users from your contacts to join your channel Add up to 50 administrators
from us


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