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
4115e231
Commit
4115e231
authored
Feb 19, 2017
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
block rm: use Marshalers instead of PostRun to process output
License: MIT Signed-off-by:
Kevin Atkinson
<
k@kevina.org
>
parent
584c0956
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
core/commands/block.go
core/commands/block.go
+12
-14
No files found.
core/commands/block.go
View file @
4115e231
...
...
@@ -280,21 +280,19 @@ It takes a list of base58 encoded multihashs to remove.
}
res
.
SetOutput
(
ch
)
},
PostRun
:
func
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
if
res
.
Error
()
!=
nil
{
return
}
outChan
,
ok
:=
res
.
Output
()
.
(
<-
chan
interface
{})
if
!
ok
{
res
.
SetError
(
u
.
ErrCast
(),
cmds
.
ErrNormal
)
return
}
res
.
SetOutput
(
nil
)
Marshalers
:
cmds
.
MarshalerMap
{
cmds
.
Text
:
func
(
res
cmds
.
Response
)
(
io
.
Reader
,
error
)
{
outChan
,
ok
:=
res
.
Output
()
.
(
<-
chan
interface
{})
if
!
ok
{
return
nil
,
u
.
ErrCast
()
}
err
:=
util
.
ProcRmOutput
(
outChan
,
res
.
Stdout
(),
res
.
Stderr
())
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
}
err
:=
util
.
ProcRmOutput
(
outChan
,
res
.
Stdout
(),
res
.
Stderr
())
if
err
!=
nil
{
return
nil
,
err
}
return
nil
,
nil
},
},
Type
:
util
.
RemovedBlock
{},
}
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