From 0931bb8590b07a1f0cd5340a6529c1f9539cc987 Mon Sep 17 00:00:00 2001 From: pingvincible Date: Wed, 22 Jan 2025 12:55:41 +0500 Subject: [PATCH] Return existing error instead of creating new for the same purpose Methods UnsafePush and Consume returns errNotConnected in the same conditions --- _examples/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/client/client.go b/_examples/client/client.go index e375653..a721e8c 100644 --- a/_examples/client/client.go +++ b/_examples/client/client.go @@ -301,7 +301,7 @@ func (client *Client) Push(data []byte) error { client.m.Lock() if !client.isReady { client.m.Unlock() - return errors.New("failed to push: not connected") + return errNotConnected } client.m.Unlock() for {