awesome-compose/go-mysql-redis/vendor/gopkg.in/redis.v5/internal/unsafe.go
vishal979 207f73ab81 add go mysql redis sample
Signed-off-by: vishal979 <shantapowertech2@gmail.com>
2020-07-04 19:38:53 +05:30

15 lines
289 B
Go

// +build !appengine
package internal
import (
"reflect"
"unsafe"
)
func BytesToString(b []byte) string {
bytesHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))
strHeader := reflect.StringHeader{bytesHeader.Data, bytesHeader.Len}
return *(*string)(unsafe.Pointer(&strHeader))
}