MCPcopy Index your code
hub / github.com/LagrangeDev/LagrangeGo / S2B

Function S2B

utils/string.go:26–28  ·  view source on GitHub ↗

S2B converts string to a byte slice without memory allocation. Note it may break if string and/or slice header will change in the future go versions.

(s string)

Source from the content-addressed store, hash-verified

24// Note it may break if string and/or slice header will change
25// in the future go versions.
26func S2B(s string) (b []byte) {
27 return unsafe.Slice(unsafe.StringData(s), len(s))
28}
29
30func MustParseHexStr(s string) []byte {
31 result, err := hex.DecodeString(s)

Callers 12

FormatMethod · 0.92
NewDeviceVerifyMethod · 0.92
NewDeviceInfoFunction · 0.92
T16eFunction · 0.92
ParseFetchUserInfoRespFunction · 0.92
WritePacketStringMethod · 0.92
WriteLenStringMethod · 0.92
BuildElementMethod · 0.92
NewMarketFaceFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected