Got it. I was wrong. time.NewTicker would panic if duration is negative. But if the duration is used widely in negative then fine :)
Thank you for correcting On Tuesday, 22 November 2022 at 16:03:58 UTC+5:30 Volker Dobler wrote: > On Tuesday, 22 November 2022 at 11:28:15 UTC+1 nikhil...@gmail.com wrote: > >> [...] the duration value should never be less than 0 else it will panic >> > This statement is wrong, a negative time.Duration doesn't panic. > (Maybe you are talking about time.Sleep?) > > Is there any reason for not using uint? >> > Because negative durations are common and useful. > > V. > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c1ff0c7c-fca3-4bf7-9623-b97739915abfn%40googlegroups.com.