diff --git a/examples/nats-bench.go b/examples/nats-bench.go index a8409aa72..2a0df95db 100644 --- a/examples/nats-bench.go +++ b/examples/nats-bench.go @@ -47,6 +47,10 @@ func main() { usage() } + if *numMsgs < 1 { + log.Fatal("Number of messages should be greater than zero.") + } + // Setup the option block opts := nats.DefaultOptions opts.Servers = strings.Split(*urls, ",")