From 0845e5dd9451723a4a3d13ed18e7f4d5075d63f7 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 24 Apr 2025 15:39:07 -0300 Subject: [PATCH] do not print a bunch of zeroes when serializing event pointers with empty author. --- pointers_easyjson.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pointers_easyjson.go b/pointers_easyjson.go index b2ea8b0..1973e24 100644 --- a/pointers_easyjson.go +++ b/pointers_easyjson.go @@ -1,5 +1,3 @@ -// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. - package nostr import ( @@ -204,7 +202,7 @@ func easyjson33014d6eEncodeFiatjafComNostr1(out *jwriter.Writer, in EventPointer out.RawByte(']') } } - if true { + if in.Author != ZeroPK { const prefix string = ",\"author\":" out.RawString(prefix) out.String(in.Author.Hex()) @@ -311,12 +309,12 @@ func easyjson33014d6eEncodeFiatjafComNostr2(out *jwriter.Writer, in EntityPointe out.RawString(prefix[1:]) out.String(in.PublicKey.Hex()) } - if in.Kind != 0 { + { const prefix string = ",\"kind\":" out.RawString(prefix) out.Uint(uint(in.Kind)) } - if in.Identifier != "" { + { const prefix string = ",\"identifier\":" out.RawString(prefix) out.String(in.Identifier)