@cryptotaxi247 / kubo / commits / 2b0c89a5c

commands/diag: switch clarity

Juan Batiz-Benet committed Jan 26, 2015 at 18:50 UTC 2b0c89a5c73a646f7bb351810fe4fe9704239d3e
1 file changed +7 -9
core/commands/diag.go
+7 -9
@@ -106,7 +106,6 @@ connected peers and latencies between them.
106 switch vis {
107 case visD3:
108 res.SetOutput(bytes.NewReader(diag.GetGraphJson(info)))
109 - return
109 case visDot:
110 var buf bytes.Buffer
111 w := diag.DotWriter{W: &buf}
@@ -116,15 +115,14 @@ connected peers and latencies between them.
115 return
116 }
117 res.SetOutput(io.Reader(&buf))
119 - return
120 - }
121 -
122 - output, err := stdDiagOutputMarshal(standardDiagOutput(info))
123 - if err != nil {
124 - res.SetError(err, cmds.ErrNormal)
125 - return
118 + default:
119 + output, err := stdDiagOutputMarshal(standardDiagOutput(info))
120 + if err != nil {
121 + res.SetError(err, cmds.ErrNormal)
122 + return
123 + }
124 + res.SetOutput(output)
125 }
127 - res.SetOutput(output)
126 },
127 }
128