Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
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
jacobsa-fuse
Commits
a25c297e
Commit
a25c297e
authored
Jul 28, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OutMessage.AppendString
parent
bb88db68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
internal/buffer/out_message.go
internal/buffer/out_message.go
+10
-2
No files found.
internal/buffer/out_message.go
View file @
a25c297e
...
...
@@ -103,8 +103,16 @@ func (b *OutMessage) Append(src []byte) {
// Equivalent to growing by the length of s, then copying s over the new
// segment. Panics if there is not enough room available.
func
(
b
*
OutMessage
)
AppendString
(
s
string
)
{
panic
(
"TODO"
)
func
(
b
*
OutMessage
)
AppendString
(
src
string
)
{
p
:=
b
.
GrowNoZero
(
uintptr
(
len
(
src
)))
if
p
==
nil
{
panic
(
fmt
.
Sprintf
(
"Can't grow %d bytes"
,
len
(
src
)))
}
sh
:=
(
*
reflect
.
StringHeader
)(
unsafe
.
Pointer
(
&
src
))
memmove
(
p
,
unsafe
.
Pointer
(
sh
.
Data
),
uintptr
(
sh
.
Len
))
return
}
// Return the current size of the buffer.
...
...
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