diff --git a/models/data.go b/models/data.go index e5815d9..ce8c5d1 100644 --- a/models/data.go +++ b/models/data.go @@ -3,7 +3,7 @@ package models import "encoding/json" type Data struct { - Action string `json:"action"` + Action string `json:"action,omitempty"` Topic string `json:"topic"` Data any `json:"data"` } diff --git a/pubSub.go b/pubSub.go index 1011532..1211ddd 100644 --- a/pubSub.go +++ b/pubSub.go @@ -53,7 +53,7 @@ func (ps *Pubsub) worker() { func(c func(any), d any) { defer func() { recover() }() c(d) - }(cb, job.Data) + }(cb, job) } } }