mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
28ebbd9bf1
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.
9 lines
182 B
Go
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))
|
|
}
|