From ac4bc3d2acf763151345e89df51937510aa707f7 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Thu, 17 Aug 2023 12:31:08 +0300 Subject: [PATCH] fix... --- listener.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/listener.go b/listener.go index 2612bd2..1ac7d2a 100644 --- a/listener.go +++ b/listener.go @@ -82,12 +82,9 @@ func notifyNative[T string | []byte](ctx context.Context, db *DB, channel string func UnmarshalNotification[T any](n *Notification) (T, error) { var payload T - b, err := stringToBytes(n.Payload) - if err != nil { - return payload, err - } + b := stringToBytes(n.Payload) - err = json.Unmarshal(b, &payload) + err := json.Unmarshal(b, &payload) if err != nil { return payload, err }