Commit a31e0304 authored by Kirill Smelkov's avatar Kirill Smelkov

mem: Adjust docstrings to Go style

parent 65c399f0
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
"unsafe" "unsafe"
) )
// string -> []byte without copying // Bytes converts string -> []byte without copying
func Bytes(s string) []byte { func Bytes(s string) []byte {
var b []byte var b []byte
bp := (*reflect.SliceHeader)(unsafe.Pointer(&b)) bp := (*reflect.SliceHeader)(unsafe.Pointer(&b))
...@@ -35,7 +35,7 @@ func Bytes(s string) []byte { ...@@ -35,7 +35,7 @@ func Bytes(s string) []byte {
return b return b
} }
// []byte -> string without copying // String converts []byte -> string without copying
func String(b []byte) string { func String(b []byte) string {
var s string var s string
sp := (*reflect.StringHeader)(unsafe.Pointer(&s)) sp := (*reflect.StringHeader)(unsafe.Pointer(&s))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment