mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-12 00:45:31 +00:00
14 lines
222 B
Go
14 lines
222 B
Go
package helpers
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
func StringToBytes(s string) []byte {
|
|
return unsafe.Slice(unsafe.StringData(s), len(s))
|
|
}
|
|
|
|
func BytesToString(b []byte) string {
|
|
return unsafe.String(unsafe.SliceData(b), len(b))
|
|
}
|