From b8ef9fc4bcccc6c024edaa8e9c91a6bf87f83dd9 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:23:28 +0000 Subject: bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645) --- vendor/github.com/uptrace/bun/util.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'vendor/github.com/uptrace/bun/util.go') diff --git a/vendor/github.com/uptrace/bun/util.go b/vendor/github.com/uptrace/bun/util.go index 09ffbb996..97ed9228a 100644 --- a/vendor/github.com/uptrace/bun/util.go +++ b/vendor/github.com/uptrace/bun/util.go @@ -1,6 +1,10 @@ package bun -import "reflect" +import ( + "fmt" + "reflect" + "strings" +) func indirect(v reflect.Value) reflect.Value { switch v.Kind() { @@ -66,3 +70,19 @@ func sliceElemType(v reflect.Value) reflect.Type { } return indirectType(elemType) } + +// appendComment adds comment in the header of the query into buffer +func appendComment(b []byte, name string) []byte { + if name == "" { + return b + } + name = strings.Map(func(r rune) rune { + if r == '\x00' { + return -1 + } + return r + }, name) + name = strings.ReplaceAll(name, `/*`, `/\*`) + name = strings.ReplaceAll(name, `*/`, `*\/`) + return append(b, fmt.Sprintf("/* %s */ ", name)...) +} -- cgit v1.2.3