wagslane / go-rabbitmq

A wrapper of streadway/amqp that provides reconnection logic and sane defaults
https://blog.boot.dev/golang/connecting-to-rabbitmq-in-golang-easy/
MIT License
768 stars 125 forks source link

Error on newConn #96

Closed amitrahav closed 1 year ago

amitrahav commented 1 year ago

I'm getting an undefined error when trying to run the package like the examples... Am I missing something or the docs need to change?

The error:

<file>:18:26: undefined: rabbitmq.Conn
<file>47:30: undefined: rabbitmq.NewConn
<file>:49:12: undefined: rabbitmq.WithConnectionOptionsLogging (exit status 2)

Here is my initial rabbitmq file:

import rabbitmq "github.com/wagslane/go-rabbitmq"

var connection rabbitmq.Conn
connection, err := rabbitmq.NewConn(
 getConnectionString(),
 rabbitmq.WithConnectionOptionsLogging,
)

This is relevant part of my project's go.mod:

go 1.17

require (
   github.com/wagslane/go-rabbitmq v0.10.0
)

Thanx

wagslane commented 1 year ago

Yeah please check the godoc, the main branch right now has some breaking changes that will be released soon