fcbc25e789
We are replacing the very outdated redigo Go module with the official redis Go module, go-redis. Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
21 lines
353 B
Go
21 lines
353 B
Go
//go:build !appengine
|
|
// +build !appengine
|
|
|
|
package rediscmd
|
|
|
|
import "unsafe"
|
|
|
|
// String converts byte slice to string.
|
|
func String(b []byte) string {
|
|
return *(*string)(unsafe.Pointer(&b))
|
|
}
|
|
|
|
// Bytes converts string to byte slice.
|
|
func Bytes(s string) []byte {
|
|
return *(*[]byte)(unsafe.Pointer(
|
|
&struct {
|
|
string
|
|
Cap int
|
|
}{s, len(s)},
|
|
))
|
|
}
|