Files
open-cluster-management/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
Jian Qiu 46de05b285 Upgrade clusterprofile API (#1316)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2026-01-07 08:56:35 +00:00

22 lines
649 B
Go

// This file will only be included to the build if neither
// easyjson_nounsafe nor appengine build tag is set. See README notes
// for more details.
//+build !easyjson_nounsafe
//+build !appengine
package jlexer
import (
"unsafe"
)
// bytesToStr creates a string pointing at the slice to avoid copying.
//
// Warning: the string returned by the function should be used with care, as the whole input data
// chunk may be either blocked from being freed by GC because of a single string or the buffer.Data
// may be garbage-collected even when the string exists.
func bytesToStr(data []byte) string {
return *(*string)(unsafe.Pointer(&data))
}