diff options
Diffstat (limited to 'unsafe.go')
-rw-r--r-- | unsafe.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unsafe.go b/unsafe.go new file mode 100644 index 0000000..4a7b2d0 --- /dev/null +++ b/unsafe.go @@ -0,0 +1,7 @@ +package main + +import "unsafe" + +func stringToBytes(s string) (bytes []byte) { + return unsafe.Slice(unsafe.StringData(s), len(s)) +} |