Yes, I am using TestMain. But signal.Notify is not helping me. 2019년 1월 10일 목요일 오후 2시 28분 10초 UTC+9, Justin Israel 님의 말: > > > > On Thu, Jan 10, 2019 at 6:24 PM 김용빈 <kyb...@gmail.com <javascript:>> > wrote: > >> 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? >> > > A custom TestMain() is a good way to add setup and teardown functionality > around the entire test process: > https://golang.org/pkg/testing/#hdr-Main > > It won't help you if you kill the "go test" process though. In that case > you would need a SIGTERM handler via signal.Notify() > >> -- >> 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.