Похожие чаты

> Also, I think web go playground don't work well

with this sort of thing.
You need to run it from terminal or somewhere and insert a SIGINT.

The SIGINT catcher somehow did the 10 second sleep, shouldn't they get killed instead?

6 ответов

22 просмотра

Your main function doesn't end right away. It sleeps for an hour. So sigint would sleep for 10 seconds and then exit

Thilség-Tarnishsunder Автор вопроса

I see then. So how would one lock a program into waiting for cleanup to finish when interupt is called? For example, something like panic: defer func(){ if recov...... }()

Thilség Tarnishsunder
I see then. So how would one lock a program into w...

sigint := make(chan os.Signal) signal.Notify(sigint, os.Interrupt) fmt.Println("Run your code...") <-sigint fmt.Println("clean up and exit")


sigint := make(chan os.Signal) signal.Notify(s...

Wouldn't it be better if you did that using Signal/Broadcast?

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта