diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2e00e19..baa57c9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,10 +12,10 @@ jobs: GOPROXY: "https://proxy.golang.org,direct" steps: - - name: Set up Go 1.18 + - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.18 + go-version: "1.20" id: go - name: Check out code into the Go module directory diff --git a/go.mod b/go.mod index 5b05f78..f94e2ff 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/wagslane/go-rabbitmq -go 1.17 +go 1.20 require github.com/rabbitmq/amqp091-go v1.5.0 diff --git a/internal/channelmanager/safe_wraps.go b/internal/channelmanager/safe_wraps.go index 57f6117..5182dfe 100644 --- a/internal/channelmanager/safe_wraps.go +++ b/internal/channelmanager/safe_wraps.go @@ -144,7 +144,8 @@ func (chanManager *ChannelManager) PublishSafe( chanManager.channelMux.RLock() defer chanManager.channelMux.RUnlock() - return chanManager.channel.Publish( + return chanManager.channel.PublishWithContext( + context.Background(), exchange, key, mandatory, diff --git a/internal/dispatcher/dispatcher_test.go b/internal/dispatcher/dispatcher_test.go index 437d1c8..afc5509 100644 --- a/internal/dispatcher/dispatcher_test.go +++ b/internal/dispatcher/dispatcher_test.go @@ -7,9 +7,6 @@ import ( func TestNewDispatcher(t *testing.T) { d := NewDispatcher() - if d == nil { - t.Error("Dispatcher is nil") - } if d.subscribers == nil { t.Error("Dispatcher subscribers is nil") }