Browse Source

This PR fixes the bug described in issue #34.

pull/36/head
Rafal Zajac 4 years ago
parent
commit
648b469afe
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      publish.go

+ 3
- 3
publish.go View File

@ -134,7 +134,7 @@ func WithPublisherOptionsLogger(log Logger) func(options *PublisherOptions) {
// on the channel of Returns that you should setup a listener on.
// Flow controls are automatically handled as they are sent from the server, and publishing
// will fail with an error when the server is requesting a slowdown
func NewPublisher(url string, config amqp.Config, optionFuncs ...func(*PublisherOptions)) (Publisher, <-chan Return, error) {
func NewPublisher(url string, config amqp.Config, optionFuncs ...func(*PublisherOptions)) (*Publisher, <-chan Return, error) {
options := &PublisherOptions{}
for _, optionFunc := range optionFuncs {
optionFunc(options)
@ -145,10 +145,10 @@ func NewPublisher(url string, config amqp.Config, optionFuncs ...func(*Publisher
chManager, err := newChannelManager(url, config, options.Logger)
if err != nil {
return Publisher{}, nil, err
return nil, nil, err
}
publisher := Publisher{
publisher := &Publisher{
chManager: chManager,
notifyReturnChan: make(chan Return, 1),
disablePublishDueToFlow: false,


Loading…
Cancel
Save