Replacing usages of fmt.Sprint with faster alternatives

Signed-off-by: Philippe Antoine <contact@catenacyber.fr>
Этот коммит содержится в:
Catena cyber
2023-11-03 11:18:18 +01:00
коммит произвёл GitHub
родитель 43f4734eae
Коммит 04e7b6bc9e
8 изменённых файлов: 21 добавлений и 19 удалений

Просмотреть файл

@@ -9,6 +9,7 @@ import (
"html"
"html/template"
"io"
"strconv"
"strings"
"time"
@@ -343,9 +344,9 @@ func getFormattedPostTime(user *model.User, post *model.Post, useMilitaryTime bo
return formattedPostTime{
Time: localTime,
Year: fmt.Sprintf("%d", localTime.Year()),
Year: strconv.Itoa(localTime.Year()),
Month: translateFunc(localTime.Month().String()),
Day: fmt.Sprintf("%d", localTime.Day()),
Day: strconv.Itoa(localTime.Day()),
Hour: hour,
Minute: fmt.Sprintf("%02d"+period, localTime.Minute()),
TimeZone: zone,