summaryrefslogtreecommitdiff
path: root/sent.go
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2025-03-08 22:26:47 +0000
committerDmitry Ilvokhin <d@ilvokhin.com>2025-03-08 22:26:47 +0000
commit5c2b8ff9b7a6c239424f54f3a818b1916253955d (patch)
treefa1fa63a0e2c3757d6290c45821952f8a894eebd /sent.go
parent5688f1493026eb4cf96f1abd6d961a5801f1dd26 (diff)
downloadflatbot-5c2b8ff9b7a6c239424f54f3a818b1916253955d.tar.gz
flatbot-5c2b8ff9b7a6c239424f54f3a818b1916253955d.tar.bz2
flatbot-5c2b8ff9b7a6c239424f54f3a818b1916253955d.zip
Manage options with CLI flags
Diffstat (limited to 'sent.go')
-rw-r--r--sent.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/sent.go b/sent.go
index 0c72e6b..f21b791 100644
--- a/sent.go
+++ b/sent.go
@@ -54,6 +54,9 @@ func removeDelisted(sent []flat, allFlats []flat) []flat {
}
func writeSent(sent []flat, filename string) error {
+ if !slices.IsSortedFunc(sent, compareID) {
+ slices.SortFunc(sent, compareID)
+ }
jsonData, err := json.Marshal(sent)
if err != nil {
return err