Files
Erik Dubbelboer 28ebbd9bf1 Drop support before go1.20 (#2022)
We still had old implementations of s2b and b2s that didn't require
unsafe.StringData and unsafe.SliceData that were added in go1.20. Since
we don't support go1.20 anymore we can drop these functions.
2025-06-15 05:14:07 +02:00

10 lines
273 B
Go

package fasthttpadaptor
import "unsafe"
// b2s converts byte slice to a string without memory allocation.
// See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
func b2s(b []byte) string {
return unsafe.String(unsafe.SliceData(b), len(b))
}