From 327fd6d62d431e8fa775e996d80328b20c484c82 Mon Sep 17 00:00:00 2001 From: Charlie Tonneslan Date: Mon, 18 May 2026 07:47:03 -0400 Subject: [PATCH] stopwatch: default Interval to time.Second The doc on Model.Interval and the New() comment both say 1s, but the zero-value time.Duration meant the ticker never advanced. Initialise it in New so the documented default actually applies. Signed-off-by: Charlie Tonneslan --- stopwatch/stopwatch.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stopwatch/stopwatch.go b/stopwatch/stopwatch.go index 65facfc57..1dfec3611 100644 --- a/stopwatch/stopwatch.go +++ b/stopwatch/stopwatch.go @@ -65,7 +65,8 @@ type Model struct { // New creates a new stopwatch with 1s interval. func New(opts ...Option) Model { m := Model{ - id: nextID(), + id: nextID(), + Interval: time.Second, } for _, opt := range opts {