From 2afd6990993eb84ac466fb58bb3fb494947a36af Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 31 Jul 2023 10:20:31 +0200 Subject: [PATCH] sort email output --- email.go | 7 ++++++- version.go | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/email.go b/email.go index a5cf92d..4016b68 100644 --- a/email.go +++ b/email.go @@ -4,6 +4,7 @@ import ( "encoding/base64" "fmt" "net/smtp" + "sort" "strings" "sync" "time" @@ -45,7 +46,11 @@ func (e *Email) Send() error { return nil } - body := " - " + e.items[0] + sort.Slice(e.items, func(i, j int) bool { + return e.items[i] < e.items[j] + }) + + body := e.items[0] for _, item := range e.items[1:] { body = body + "\r\n" + item } diff --git a/version.go b/version.go index a022ab1..0b58f5a 100644 --- a/version.go +++ b/version.go @@ -1,7 +1,7 @@ // Code generated by version.sh (@generated) DO NOT EDIT. package main -var githash = "24a5e66" +var githash = "b4d27e0" var branch = "v2" -var buildstamp = "2023-07-31_08:12:46" -var commits = "66" -var version = "24a5e66-b66 - 2023-07-31_08:12:46" +var buildstamp = "2023-07-31_08:20:10" +var commits = "67" +var version = "b4d27e0-b67 - 2023-07-31_08:20:10"