mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-15 16:07:51 +03:00
dd1f3b97e5
* update go.sum * update build tag
11 lines
211 B
Go
11 lines
211 B
Go
//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))
|
|
}
|