From 554e0c38d07fcb0ee269d6f62cb0ab7bda230129 Mon Sep 17 00:00:00 2001 From: Yurii Soldak Date: Mon, 8 Jul 2024 15:25:07 +0200 Subject: [PATCH] fix condition --- adapter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapter.go b/adapter.go index 28c190e..2314e2d 100644 --- a/adapter.go +++ b/adapter.go @@ -132,7 +132,7 @@ func (a *Adapter) Receive() (*Message, error) { // Wait for a message with the given command and direction. func (a *Adapter) Wait(command Command, direction Direction, timeout time.Duration) (*Message, error) { start := time.Now() - for time.Since(start) > timeout { + for time.Since(start) < timeout { message, _ := a.Receive() // wait for correct message if message != nil && message.Command == command && message.Direction == direction {