The sample is based on the Pulsar Go client library's reference implmentation.
Install the library package.
$ go get -u github.com/apache/pulsar/pulsar-client-go/pulsar
Replace correct pulsar URL, token and topic name in both consumer.go and producer.go files.
Start consumer
$ cd src
$ go run consumer.go
Start producer
$ go run producer.go