diff --git a/examples/nats-bench/main.go b/examples/nats-bench/main.go index 101022145..790081214 100644 --- a/examples/nats-bench/main.go +++ b/examples/nats-bench/main.go @@ -34,7 +34,8 @@ const ( ) func usage() { - log.Fatalf("Usage: nats-bench [-s server (%s)] [--tls] [-np NUM_PUBLISHERS] [-ns NUM_SUBSCRIBERS] [-n NUM_MSGS] [-ms MESSAGE_SIZE] [-csv csvfile] \n", nats.DefaultURL) + log.Printf("Usage: nats-bench [-s server (%s)] [--tls] [-np NUM_PUBLISHERS] [-ns NUM_SUBSCRIBERS] [-n NUM_MSGS] [-ms MESSAGE_SIZE] [-csv csvfile] \n", nats.DefaultURL) + flag.PrintDefaults() } var benchmark *bench.Benchmark diff --git a/examples/nats-echo/main.go b/examples/nats-echo/main.go index 2afe8ed1d..2ef011c48 100644 --- a/examples/nats-echo/main.go +++ b/examples/nats-echo/main.go @@ -34,7 +34,8 @@ import ( // nats-echo -s demo.nats.io:4443 (TLS version) func usage() { - log.Fatalf("Usage: nats-echo [-s server] [-creds file] [-t] ") + log.Printf("Usage: nats-echo [-s server] [-creds file] [-t] \n") + flag.PrintDefaults() } func printMsg(m *nats.Msg, i int) { @@ -157,7 +158,7 @@ func lookupGeo() string { } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) - g := &geo{} + g := geo{} if err := json.Unmarshal(body, &g); err != nil { log.Fatalf("Error unmarshalling geo: %v", err) } diff --git a/examples/nats-pub/main.go b/examples/nats-pub/main.go index 5132078f8..ae37e1a9c 100644 --- a/examples/nats-pub/main.go +++ b/examples/nats-pub/main.go @@ -25,7 +25,8 @@ import ( // nats-pub -s demo.nats.io:4443 (TLS version) func usage() { - log.Fatalf("Usage: nats-pub [-s server] [-creds file] ") + log.Printf("Usage: nats-pub [-s server] [-creds file] \n") + flag.PrintDefaults() } func main() { diff --git a/examples/nats-qsub/main.go b/examples/nats-qsub/main.go index 994c34785..38274e433 100644 --- a/examples/nats-qsub/main.go +++ b/examples/nats-qsub/main.go @@ -28,7 +28,8 @@ import ( // nats-qsub -s demo.nats.io:4443 (TLS version) func usage() { - log.Fatalf("Usage: nats-qsub [-s server] [-creds file] [-t] ") + log.Printf("Usage: nats-qsub [-s server] [-creds file] [-t] \n") + flag.PrintDefaults() } func printMsg(m *nats.Msg, i int) { diff --git a/examples/nats-req/main.go b/examples/nats-req/main.go index f0a004d3b..33198fd6a 100644 --- a/examples/nats-req/main.go +++ b/examples/nats-req/main.go @@ -26,7 +26,8 @@ import ( // nats-req -s demo.nats.io:4443 (TLS version) func usage() { - log.Fatalf("Usage: nats-req [-s server] [-creds file] ") + log.Printf("Usage: nats-req [-s server] [-creds file] \n") + flag.PrintDefaults() } func main() { diff --git a/examples/nats-rply/main.go b/examples/nats-rply/main.go index 0eca7586f..0a020d202 100644 --- a/examples/nats-rply/main.go +++ b/examples/nats-rply/main.go @@ -27,7 +27,8 @@ import ( // nats-rply -s demo.nats.io:4443 (TLS version) func usage() { - log.Fatalf("Usage: nats-rply [-s server] [-creds file] [-t] ") + log.Printf("Usage: nats-rply [-s server] [-creds file] [-t] \n") + flag.PrintDefaults() } func printMsg(m *nats.Msg, i int) { diff --git a/examples/nats-sub/main.go b/examples/nats-sub/main.go index 19b5716b7..4e4826a50 100644 --- a/examples/nats-sub/main.go +++ b/examples/nats-sub/main.go @@ -27,7 +27,8 @@ import ( // nats-sub -s demo.nats.io:4443 (TLS version) func usage() { - log.Fatalf("Usage: nats-sub [-s server] [-creds file] [-t] ") + log.Printf("Usage: nats-sub [-s server] [-creds file] [-t] \n") + flag.PrintDefaults() } func printMsg(m *nats.Msg, i int) {