From d673df0ca10579bc3ca292ac2a79ef2b2df71bd6 Mon Sep 17 00:00:00 2001 From: George Suntres Date: Thu, 23 Apr 2026 14:33:30 -0400 Subject: [PATCH] Add omitempty in event struct --- audit.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/audit.go b/audit.go index c5c5aec..f8dbb1a 100644 --- a/audit.go +++ b/audit.go @@ -12,11 +12,11 @@ const ( type AuditResult struct { Op Op `bson:"op" json:"op"` - Entity string `bson:"entity" json:"entity"` - Data any `bson:"data" json:"data"` - Before any `bson:"before" json:"before"` - After any `bson:"after" json:"after"` - Context any `bson:"context" json:"context"` + Entity string `bson:"entity,omitempty" json:"entity,omitempty"` + Data any `bson:"data,omitempty" json:"data,omitempty",` + Before any `bson:"before,omitempty" json:"before,omitempty"` + After any `bson:"after,omitempty" json:"after,omitempty"` + Context any `bson:"context,omitempty" json:"context,omitempty"` } type OnAudit func(audit *AuditResult) error \ No newline at end of file