summaryrefslogtreecommitdiff
path: root/internal/timeline/manager.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2023-08-09 18:40:32 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-09 18:40:32 +0200
commitdbf487effb9c3bb0da5b4d743c45734410bb11ea (patch)
tree9419c3f7f25b74fa1216a2ae89c603675cb49955 /internal/timeline/manager.go
parentupdate coc (#2090) (diff)
downloadgotosocial-dbf487effb9c3bb0da5b4d743c45734410bb11ea.tar.xz
[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.
Diffstat (limited to 'internal/timeline/manager.go')
-rw-r--r--internal/timeline/manager.go1
1 files changed, 1 insertions, 0 deletions
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