MCPcopy Index your code
hub / github.com/segmentio/encoding / stringToBytes

Function stringToBytes

json/codec.go:1052–1058  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

1050}
1051
1052func stringToBytes(s string) []byte {
1053 return *(*[]byte)(unsafe.Pointer(&sliceHeader{
1054 Data: *(*unsafe.Pointer)(unsafe.Pointer(&s)),
1055 Len: len(s),
1056 Cap: len(s),
1057 }))
1058}
1059
1060type sliceHeader struct {
1061 Data unsafe.Pointer

Callers 1

encodeNumberMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…