diff options
Diffstat (limited to 'vendor/github.com/uptrace/bun/extra')
-rw-r--r-- | vendor/github.com/uptrace/bun/extra/bunotel/otel.go | 3 | ||||
-rw-r--r-- | vendor/github.com/uptrace/bun/extra/bunotel/safe.go | 11 | ||||
-rw-r--r-- | vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go | 20 |
3 files changed, 2 insertions, 32 deletions
diff --git a/vendor/github.com/uptrace/bun/extra/bunotel/otel.go b/vendor/github.com/uptrace/bun/extra/bunotel/otel.go index d0672e7c2..66b88e989 100644 --- a/vendor/github.com/uptrace/bun/extra/bunotel/otel.go +++ b/vendor/github.com/uptrace/bun/extra/bunotel/otel.go @@ -16,6 +16,7 @@ import ( "github.com/uptrace/bun" "github.com/uptrace/bun/dialect" + "github.com/uptrace/bun/internal" "github.com/uptrace/bun/schema" "github.com/uptrace/opentelemetry-go-extra/otelsql" ) @@ -169,7 +170,7 @@ func (h *QueryHook) eventQuery(event *bun.QueryEvent) string { func unformattedQuery(event *bun.QueryEvent) string { if event.IQuery != nil { if b, err := event.IQuery.AppendQuery(schema.NewNopFormatter(), nil); err == nil { - return bytesToString(b) + return internal.String(b) } } return string(event.QueryTemplate) diff --git a/vendor/github.com/uptrace/bun/extra/bunotel/safe.go b/vendor/github.com/uptrace/bun/extra/bunotel/safe.go deleted file mode 100644 index fab151a78..000000000 --- a/vendor/github.com/uptrace/bun/extra/bunotel/safe.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build appengine - -package internal - -func bytesToString(b []byte) string { - return string(b) -} - -func stringToBytes(s string) []byte { - return []byte(s) -} diff --git a/vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go b/vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go deleted file mode 100644 index 67b687cbe..000000000 --- a/vendor/github.com/uptrace/bun/extra/bunotel/unsafe.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build !appengine -// +build !appengine - -package bunotel - -import "unsafe" - -func bytesToString(b []byte) string { - if len(b) == 0 { - return "" - } - return unsafe.String(&b[0], len(b)) -} - -func stringToBytes(s string) []byte { - if s == "" { - return []byte{} - } - return unsafe.Slice(unsafe.StringData(s), len(s)) -} |