提交 28a610a1 作者: Steven Allen

ping: return an error when ping count <= 0

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
上级 aa95dcbd
......@@ -103,6 +103,10 @@ trip latency information.
return
}
if numPings <= 0 {
res.SetError(fmt.Errorf("error: ping count must be greater than 0, was %d", numPings), cmdkit.ErrNormal)
}
outChan := pingPeer(ctx, n, peerID, numPings)
res.SetOutput(outChan)
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论