2024-11-08 14:51:23 +01:00
|
|
|
//go:build !appengine
|
2023-05-09 19:19:48 +02:00
|
|
|
// +build !appengine
|
|
|
|
|
|
|
|
package bunotel
|
|
|
|
|
|
|
|
import "unsafe"
|
|
|
|
|
|
|
|
func bytesToString(b []byte) string {
|
2024-11-08 14:51:23 +01:00
|
|
|
if len(b) == 0 {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return unsafe.String(&b[0], len(b))
|
2023-05-09 19:19:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func stringToBytes(s string) []byte {
|
2024-11-08 14:51:23 +01:00
|
|
|
if s == "" {
|
|
|
|
return []byte{}
|
|
|
|
}
|
|
|
|
return unsafe.Slice(unsafe.StringData(s), len(s))
|
2023-05-09 19:19:48 +02:00
|
|
|
}
|