blob: 31b623fa4568a618060bb6cfd87baa5feb668e91 (
plain)
1
2
3
4
5
6
7
8
9
10
|
//go:build go1.20 || go1.21
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))
}
|