bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645)

This commit is contained in:
kim
2025-01-14 14:23:28 +00:00
committed by GitHub
parent e77c7e16b6
commit b8ef9fc4bc
89 changed files with 907 additions and 4123 deletions

View File

@ -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)...)
}