Hmm.. I tested it again and it works today. I think it was just my problem.
Sorry for the confusion and thank you! 2019년 1월 10일 목요일 오후 5시 25분 12초 UTC+9, Justin Israel 님의 말: > > > > On Thu, Jan 10, 2019, 9:14 PM 김용빈 <kyb...@gmail.com <javascript:>> wrote: > >> Hi, Justin. Thank you for the response. >> >> But it didn't work for me. that means when I terminate it with Ctrl+C, it >> doesn't print CLEANUP. >> >> I am using linux (manjaro) terminal now. >> > > I am not sure why it wouldn't work. I confirmed it on an Ubuntu distro. > > >> 2019년 1월 10일 목요일 오후 2시 41분 24초 UTC+9, Justin Israel 님의 말: >>> >>> Oh, I see. Well also adding a signal handler for SIGINT/SIGTERM also >>> works for me: >>> https://play.golang.org/p/93VmTTgE4YB >>> >>> Justin >>> >>> >>> On Thu, Jan 10, 2019 at 6:29 PM 김용빈 <kyb...@gmail.com> wrote: >>> >>>> Sorry I didn't clarify but I mean when it is killed/terminated. >>>> >>>> 2019년 1월 10일 목요일 오후 2시 24분 35초 UTC+9, 김용빈 님의 말: >>>> >>>>> I tried signal.Notify but it seems it doesn't work. >>>>> >>>>> Then I find this: >>>>> https://github.com/golang/go/issues/15553#issuecomment-217162874 >>>>> >>>>> So what should I do to make my function always run at exit in test? >>>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "golang-nuts" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to golang-nuts...@googlegroups.com. >>> >>> >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.