Files
fasthttp/s2b_new.go
T
2023-02-03 08:41:39 +01:00

12 lines
218 B
Go

//go:build go1.20
// +build go1.20
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))
}