mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-13 15:46:49 +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.
10 lines
266 B
Go
10 lines
266 B
Go
package fasthttp
|
|
|
|
import "unsafe"
|
|
|
|
// b2s converts byte slice to a string without memory allocation.
|
|
// See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
|
|
func b2s(b []byte) string {
|
|
return unsafe.String(unsafe.SliceData(b), len(b))
|
|
}
|