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/db/bundb/list.go | 1 + 1 file changed, 1 insertion(+) (limited to 'internal/db/bundb/list.go') diff --git a/internal/db/bundb/list.go b/internal/db/bundb/list.go index ad970f539..5cf10ce3c 100644 --- a/internal/db/bundb/list.go +++ b/internal/db/bundb/list.go @@ -429,6 +429,7 @@ func (l *listDB) PutListEntries(ctx context.Context, entries []*gtsmodel.ListEnt // Finally, insert each list entry into the database. return l.db.RunInTx(ctx, func(tx bun.Tx) error { for _, entry := range entries { + entry := entry // rescope if err := l.state.Caches.GTS.ListEntry().Store(entry, func() error { _, err := tx. NewInsert(). -- cgit v1.2.3