diff --git a/examples/stan-bench.go b/examples/stan-bench/main.go similarity index 100% rename from examples/stan-bench.go rename to examples/stan-bench/main.go diff --git a/examples/stan-pub.go b/examples/stan-pub/main.go similarity index 98% rename from examples/stan-pub.go rename to examples/stan-pub/main.go index 32a2430..ce6537e 100644 --- a/examples/stan-pub.go +++ b/examples/stan-pub/main.go @@ -1,5 +1,4 @@ // Copyright 2012-2016 Apcera Inc. All rights reserved. -// +build ignore package main @@ -79,7 +78,7 @@ func main() { ch <- true } - if async != true { + if !async { err = sc.Publish(subj, msg) if err != nil { log.Fatalf("Error during publish: %v\n", err) diff --git a/examples/stan-sub.go b/examples/stan-sub/main.go similarity index 97% rename from examples/stan-sub.go rename to examples/stan-sub/main.go index 3fef21d..dd415f9 100644 --- a/examples/stan-sub.go +++ b/examples/stan-sub/main.go @@ -1,5 +1,4 @@ // Copyright 2012-2016 Apcera Inc. All rights reserved. -// +build ignore package main @@ -106,9 +105,9 @@ func main() { if startSeq != 0 { startOpt = stan.StartAtSequence(startSeq) - } else if deliverLast == true { + } else if deliverLast { startOpt = stan.StartWithLastReceived() - } else if deliverAll == true { + } else if deliverAll { log.Print("subscribing with DeliverAllAvailable") startOpt = stan.DeliverAllAvailable() } else if startDelta != "" { @@ -138,7 +137,7 @@ func main() { cleanupDone := make(chan bool) signal.Notify(signalChan, os.Interrupt) go func() { - for _ = range signalChan { + for range signalChan { fmt.Printf("\nReceived an interrupt, unsubscribing and closing connection...\n\n") // Do not unsubscribe a durable on exit, except if asked to. if durable == "" || unsubscribe {