Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
052d387a
Commit
052d387a
authored
Nov 16, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands2: Fixed 'block' command for req.Files() API
parent
3a9a62eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
core/commands2/block.go
core/commands2/block.go
+9
-5
No files found.
core/commands2/block.go
View file @
052d387a
...
@@ -2,7 +2,6 @@ package commands
...
@@ -2,7 +2,6 @@ package commands
import
(
import
(
"bytes"
"bytes"
"io"
"io/ioutil"
"io/ioutil"
"time"
"time"
...
@@ -97,12 +96,17 @@ It reads from stdin, and <key> is a base58 encoded multihash.
...
@@ -97,12 +96,17 @@ It reads from stdin, and <key> is a base58 encoded multihash.
return
nil
,
err
return
nil
,
err
}
}
in
,
ok
:=
req
.
Arguments
()[
0
]
.
(
io
.
Reader
)
file
,
err
:=
req
.
Files
()
.
NextFile
()
if
!
ok
{
if
err
!=
nil
{
return
nil
,
u
.
ErrCast
()
return
nil
,
err
}
data
,
err
:=
ioutil
.
ReadAll
(
file
)
if
err
!=
nil
{
return
nil
,
err
}
}
data
,
err
:
=
ioutil
.
ReadAll
(
in
)
err
=
file
.
Close
(
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
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