summaryrefslogtreecommitdiff
path: root/internal/db
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/db
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/db')
-rw-r--r--internal/db/bundb/list.go1
1 files changed, 1 insertions, 0 deletions
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().