提交 2b0c89a5 作者: Juan Batiz-Benet

commands/diag: switch clarity

上级 76d9d89a
......@@ -106,7 +106,6 @@ connected peers and latencies between them.
switch vis {
case visD3:
res.SetOutput(bytes.NewReader(diag.GetGraphJson(info)))
return
case visDot:
var buf bytes.Buffer
w := diag.DotWriter{W: &buf}
......@@ -116,15 +115,14 @@ connected peers and latencies between them.
return
}
res.SetOutput(io.Reader(&buf))
return
}
output, err := stdDiagOutputMarshal(standardDiagOutput(info))
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
default:
output, err := stdDiagOutputMarshal(standardDiagOutput(info))
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}
res.SetOutput(output)
}
res.SetOutput(output)
},
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论