[chore] update bun libraries to v1.2.5 (#3528)

* update bun libraries to v1.2.5

* pin old v1.29.0 of otel
This commit is contained in:
kim 2024-11-08 13:51:23 +00:00 committed by GitHub
commit 29007b1b88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
59 changed files with 4181 additions and 1196 deletions

View file

@ -1,3 +1,3 @@
# OpenTelemetry instrumentation for Bun
See [example](../example/opentelemetry) for details.
See [example](../../example/opentelemetry) for details.

View file

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