Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go123
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go123
Commits
a31e0304
Commit
a31e0304
authored
Jan 09, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mem: Adjust docstrings to Go style
parent
65c399f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mem/mem.go
mem/mem.go
+2
-2
No files found.
mem/mem.go
View file @
a31e0304
...
@@ -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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment