summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/extra
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-11-08 13:51:23 +0000
committerLibravatar GitHub <noreply@github.com>2024-11-08 13:51:23 +0000
commit29007b1b886e7455ece5aa6e4d477805209fad88 (patch)
tree21b11cbf12faf71d44d43c61a2d4916b7bd82b80 /vendor/github.com/uptrace/bun/extra
parentbump ncruces/go-sqlite3 to v0.20.2 (#3524) (diff)
downloadgotosocial-29007b1b886e7455ece5aa6e4d477805209fad88.tar.xz
[chore] update bun libraries to v1.2.5 (#3528)
* update bun libraries to v1.2.5 * pin old v1.29.0 of otel
Diffstat (limited to 'vendor/github.com/uptrace/bun/extra')
-rw-r--r--vendor/github.com/uptrace/bun/extra/bunotel/README.md2
-rw-r--r--vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go16
2 files changed, 10 insertions, 8 deletions
diff --git a/vendor/github.com/uptrace/bun/extra/bunotel/README.md b/vendor/github.com/uptrace/bun/extra/bunotel/README.md
index 50b3e6c48..1773ecf02 100644
--- a/vendor/github.com/uptrace/bun/extra/bunotel/README.md
+++ b/vendor/github.com/uptrace/bun/extra/bunotel/README.md
@@ -1,3 +1,3 @@
# OpenTelemetry instrumentation for Bun
-See [example](../example/opentelemetry) for details.
+See [example](../../example/opentelemetry) for details.
diff --git a/vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go b/vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go
index 23accd40e..67b687cbe 100644
--- a/vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go
+++ b/vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go
@@ -1,3 +1,4 @@
+//go:build !appengine
// +build !appengine
package bunotel
@@ -5,14 +6,15 @@ package bunotel
import "unsafe"
func bytesToString(b []byte) string {
- return *(*string)(unsafe.Pointer(&b))
+ if len(b) == 0 {
+ return ""
+ }
+ return unsafe.String(&b[0], len(b))
}
func stringToBytes(s string) []byte {
- return *(*[]byte)(unsafe.Pointer(
- &struct {
- string
- Cap int
- }{s, len(s)},
- ))
+ if s == "" {
+ return []byte{}
+ }
+ return unsafe.Slice(unsafe.StringData(s), len(s))
}