MCPcopy Index your code
hub / github.com/maruel/panicparse / unsafeString

Function unsafeString

stack/context.go:1211–1214  ·  view source on GitHub ↗

unsafeString performs an unsafe conversion from a []byte to a string. The returned string will share the underlying memory with the []byte which thus allows the string to be mutable through the []byte. We're careful to use this method only in situations in which the []byte will not be modified. A w

(b []byte)

Source from the content-addressed store, hash-verified

1209//
1210// A workaround for the absence of https://github.com/golang/go/issues/2632.
1211func unsafeString(b []byte) string {
1212 /* #nosec G103 */
1213 return *(*string)(unsafe.Pointer(&b))
1214}

Callers 2

scanMethod · 0.85
parseArgsFunction · 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…