redis/internal/unsafe.go

13 lines
189 B
Go
Raw Normal View History

2017-01-13 14:39:59 +03:00
// +build !appengine
package internal
import (
"unsafe"
)
2018-01-11 11:07:24 +03:00
// BytesToString converts byte slice to string.
2017-01-13 14:39:59 +03:00
func BytesToString(b []byte) string {
2018-01-11 11:07:24 +03:00
return *(*string)(unsafe.Pointer(&b))
2017-01-13 14:39:59 +03:00
}