mirror of
https://github.com/redis/go-redis.git
synced 2025-08-07 12:42:55 +03:00
Fix proto.RedisError in slices
This commit is contained in:
12
internal/util/unsafe.go
Normal file
12
internal/util/unsafe.go
Normal file
@@ -0,0 +1,12 @@
|
||||
// +build !appengine
|
||||
|
||||
package util
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// BytesToString converts byte slice to string.
|
||||
func BytesToString(b []byte) string {
|
||||
return *(*string)(unsafe.Pointer(&b))
|
||||
}
|
Reference in New Issue
Block a user