From 52bbefdc5d67f83f651486a19a5dee03db545ef7 Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 11 Feb 2025 14:52:56 +0000 Subject: [PATCH] append to byte buffer instead of WriteString() to shut the linter up (i know you're reading this, linter) --- internal/db/bundb/migrations/util.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/db/bundb/migrations/util.go b/internal/db/bundb/migrations/util.go index 8d22ece05..bae5750df 100644 --- a/internal/db/bundb/migrations/util.go +++ b/internal/db/bundb/migrations/util.go @@ -87,15 +87,15 @@ func convertEnums[OldType ~string, NewType ~int16]( // Prepare a singular UPDATE statement using // SET $newColumn = (CASE $column WHEN $old THEN $new ... END) - qbuf.WriteString("UPDATE ? SET ? = (CASE ? ") + qbuf.B = append(qbuf.B, "UPDATE ? SET ? = (CASE ? "...) args = append(args, bun.Ident(table)) args = append(args, bun.Ident(newColumn)) args = append(args, bun.Ident(column)) for old, new := range mapping { - qbuf.WriteString("WHEN ? THEN ? ") + qbuf.B = append(qbuf.B, "WHEN ? THEN ? "...) args = append(args, old, new) } - qbuf.WriteString("ELSE ? END)") + qbuf.B = append(qbuf.B, "ELSE ? END)"...) args = append(args, *defaultValue) // Execute the prepared raw query with arguments.