From 017e4aea118004b333928d5a24ac826b8c31666a Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 14 Nov 2025 12:08:47 -0300 Subject: [PATCH] nip34: return events, not pointer to events. --- nip34/repository.go | 4 ++-- nip34/state.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nip34/repository.go b/nip34/repository.go index 5fd40b2..e53fade 100644 --- a/nip34/repository.go +++ b/nip34/repository.go @@ -49,7 +49,7 @@ func ParseRepository(event nostr.Event) Repository { return repo } -func (r Repository) ToEvent() *nostr.Event { +func (r Repository) ToEvent() nostr.Event { tags := make(nostr.Tags, 0, 10) tags = append(tags, nostr.Tag{"d", r.ID}) @@ -88,7 +88,7 @@ func (r Repository) ToEvent() *nostr.Event { tags = append(tags, tag) } - return &nostr.Event{ + return nostr.Event{ Kind: nostr.KindRepositoryAnnouncement, Tags: tags, CreatedAt: nostr.Now(), diff --git a/nip34/state.go b/nip34/state.go index 6417fdb..f1dc935 100644 --- a/nip34/state.go +++ b/nip34/state.go @@ -45,7 +45,7 @@ func ParseRepositoryState(event nostr.Event) RepositoryState { return st } -func (rs RepositoryState) ToEvent() *nostr.Event { +func (rs RepositoryState) ToEvent() nostr.Event { tags := make(nostr.Tags, 1, 2+len(rs.Branches)+len(rs.Tags)) tags[0] = nostr.Tag{"d", rs.ID} @@ -59,7 +59,7 @@ func (rs RepositoryState) ToEvent() *nostr.Event { tags = append(tags, nostr.Tag{"HEAD", "ref: refs/heads/" + rs.HEAD}) } - return &nostr.Event{ + return nostr.Event{ Kind: 30618, Tags: tags, CreatedAt: nostr.Now(),