The underlying Timer is not recovered by the garbage collector until the timer fires. It's better to use time.NewTimer instead and call its Stop method when the timer is no longer needed to avoid potential memory leak issues.
It's hard to run into a memory leak issue in 5 seconds, but it will potentially reduce memory pressure when there are many short-lived subscribers.
The underlying Timer is not recovered by the garbage collector until the timer fires. It's better to use time.NewTimer instead and call its Stop method when the timer is no longer needed to avoid potential memory leak issues.
It's hard to run into a memory leak issue in 5 seconds, but it will potentially reduce memory pressure when there are many short-lived subscribers.