Files
fasthttp/s2b.go
T
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

9 lines
182 B
Go

package fasthttp
import "unsafe"
// s2b converts string to a byte slice without memory allocation.
func s2b(s string) []byte {
return unsafe.Slice(unsafe.StringData(s), len(s))
}