Publish several messages. For each publication you should get a result.
cd $GOPATH/src/github.com/nats-io/stan.go/examples/stan-pubgorunmain.gofoo"msg one"gorunmain.gofoo"msg two"gorunmain.gofoo"msg three"
Run the subscriber client
Use the --all flag to receive all published messages.
cd $GOPATH/src/github.com/nats-io/stan.go/examples/stan-subgorunmain.go--all-ctest-cluster-idmyIDfoo
Connected to nats://localhost:4222 clusterID: [test-cluster] clientID: [myID]
subscribing with DeliverAllAvailable
Listening on [foo], clientID=[myID], qgroup=[] durable=[]
[#1] Received on [foo]: 'sequence:1 subject:"foo" data:"msg one" timestamp:1465962202884478817 '
[#2] Received on [foo]: 'sequence:2 subject:"foo" data:"msg two" timestamp:1465962208545003897 '
[#3] Received on [foo]: 'sequence:3 subject:"foo" data:"msg three" timestamp:1465962215567601196
Explore other subscription options
--seq<seqno>Startatseqno--allDeliverallavailablemessages--lastDeliverstartingwithlastpublishedmessage --since <duration> Deliver messages in last interval (e.g. 1s, 1hr, https://golang.org/pkg/time/#ParseDuration)
--durable<name>Durablesubscribername--unsubscribeUnsubscribethedurableonexit