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

How to Create a Private or Public Channel on Telegram? In the next window, choose the type of your channel. If you want your channel to be public, you need to develop a link for it. In the screenshot below, it’s ”/catmarketing.” If your selected link is unavailable, you’ll need to suggest another option. Hui said the time period and nature of some offences “overlapped” and thus their prison terms could be served concurrently. The judge ordered Ng to be jailed for a total of six years and six months. How to create a business channel on Telegram? (Tutorial) Co-founder of NFT renting protocol Rentable World emiliano.eth shared the group Tuesday morning on Twitter, calling out the "degenerate" community, or crypto obsessives that engage in high-risk trading.
from us


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