Closed guader closed 5 years ago
os: macos go version: 1.11.1
With the example provided, even if I call t.Stop() within a timer, process will not exit in 10s as expected. And there is no error reported.
go func() { timer := time.NewTimer(time.Second*10) fmt.Print("timer start") <- timer.C fmt.Print("timer stop") t.Stop() }() //hc.OnTermination(func() { // t.Stop() //}) t.Start()
Then I have to kill it by myself.
timer startINFO 2019/02/14 11:35:11 Accessory address is 192.168.1.163:49533 timer stop^C^C^C^C^Z [1]+ Stopped go run hklightd.go
I'm so sorry, it was my mistake. The example code I pulled shows t.Stop() but <-t.Stop().
t.Stop()
<-t.Stop()
os: macos go version: 1.11.1
With the example provided, even if I call t.Stop() within a timer, process will not exit in 10s as expected. And there is no error reported.
Then I have to kill it by myself.