diff --git a/event_easyjson.go b/event_easyjson.go index a17ebc0..a35abd3 100644 --- a/event_easyjson.go +++ b/event_easyjson.go @@ -1,5 +1,3 @@ -// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. - package nostr import ( @@ -110,20 +108,24 @@ func easyjsonF642ad3eEncodeGithubComNbdWtfGoNostr(out *jwriter.Writer, in Event) first := true _ = first { - const prefix string = ",\"id\":" - out.RawString(prefix[1:]) - out.String(in.ID) - } - { - const prefix string = ",\"pubkey\":" - out.RawString(prefix) - out.String(in.PubKey) - } - { - const prefix string = ",\"created_at\":" + const prefix string = "\"created_at\":" out.RawString(prefix) out.Int64(int64(in.CreatedAt)) } + { + if in.ID != "" { + const prefix string = ",\"id\":" + out.RawString(prefix) + out.String(in.ID) + } + } + { + if in.PubKey != "" { + const prefix string = ",\"pubkey\":" + out.RawString(prefix) + out.String(in.PubKey) + } + } { const prefix string = ",\"kind\":" out.RawString(prefix) @@ -162,9 +164,11 @@ func easyjsonF642ad3eEncodeGithubComNbdWtfGoNostr(out *jwriter.Writer, in Event) out.String(in.Content) } { - const prefix string = ",\"sig\":" - out.RawString(prefix) - out.String(in.Sig) + if in.Sig != "" { + const prefix string = ",\"sig\":" + out.RawString(prefix) + out.String(in.Sig) + } } { for key, value := range in.extra { diff --git a/filter_easyjson.go b/filter_easyjson.go index 791b507..4880d8a 100644 --- a/filter_easyjson.go +++ b/filter_easyjson.go @@ -1,5 +1,3 @@ -// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. - package nostr import (