summaryrefslogtreecommitdiff
path: root/helpers.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-08-30 20:11:30 -0500
committerJeff Carr <[email protected]>2025-08-30 20:11:30 -0500
commit5d62516c40934e21157219413934795f52238598 (patch)
treee0e0024802b4526a7d1bcdb0da05c63c233641d3 /helpers.go
parent395597646ac456b4de626450d899a6139b4c780e (diff)
schema changes to Marshal() JSON from gemini-cliv0.0.4
Diffstat (limited to 'helpers.go')
-rw-r--r--helpers.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/helpers.go b/helpers.go
index 5385944..35acf88 100644
--- a/helpers.go
+++ b/helpers.go
@@ -93,3 +93,11 @@ func (x *Chats) AppendNew(y *Chat) {
x.Chats = append(x.Chats, chat)
}
+
+// a Append() shortcut (that does Clone() with a mutex) notsure if it really works
+func (x *Chat) AppendEntry(y *ChatEntry) {
+ x.Lock()
+ defer x.Unlock()
+
+ x.Entries = append(x.Entries, proto.Clone(y).(*ChatEntry))
+}