MCPcopy Create free account
hub / github.com/apache/fory / unsafeGetBytes

Function unsafeGetBytes

go/fory/util.go:51–58  ·  view source on GitHub ↗

unsafeGetBytes converts string to byte slice.

(s string)

Source from the content-addressed store, hash-verified

49
50// unsafeGetBytes converts string to byte slice.
51func unsafeGetBytes(s string) []byte {
52 if len(s) == 0 {
53 return emptyByteSlice
54 }
55 return (*[0x7fff0000]byte)(unsafe.Pointer(
56 (*reflect.StringHeader)(unsafe.Pointer(&s)).Data),
57 )[:len(s):len(s)]
58}
59
60func SnakeCase(camel string) string {
61 var buf bytes.Buffer

Callers 2

computeStringHashFunction · 0.85
writeStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected