From dbf487effb9c3bb0da5b4d743c45734410bb11ea Mon Sep 17 00:00:00 2001 From: Daenney Date: Wed, 9 Aug 2023 18:40:32 +0200 Subject: [bugfix] Fix incorrect per-loop variable capture (#2092) These should be per iteration, not per loop. This was caught by running a build with the loopvar experiment: go build -gcflags=-d=loopvar=2. --- internal/timeline/manager.go | 1 + 1 file changed, 1 insertion(+) (limited to 'internal/timeline/manager.go') diff --git a/internal/timeline/manager.go b/internal/timeline/manager.go index 23b769c62..df0323cdb 100644 --- a/internal/timeline/manager.go +++ b/internal/timeline/manager.go @@ -119,6 +119,7 @@ func (m *manager) Start() error { // hasn't been accessed in the last hour. go func() { for now := range time.NewTicker(1 * time.Hour).C { + now := now // rescope // Define the range function inside here, // so that we can use the 'now' returned // by the ticker, instead of having to call -- cgit v1.2.3