MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / StringToByteSlice

Function StringToByteSlice

IceFireDB-SQLProxy/utils/zeroalloc.go:5–7  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

3import "unsafe"
4
5func StringToByteSlice(s string) []byte {
6 return *(*[]byte)(unsafe.Pointer(&s))
7}
8
9func ByteSliceToString(b []byte) string {
10 return *(*string)(unsafe.Pointer(&b))

Callers 1

writeCommandStrMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected