mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Refactor struct's time to remove unnecessary memory usage (#3142)
* refactor struct's time to remove unnecessary memory usage * use AsTimePtr simple code * fix tests * fix time compare * fix template on gpg * use AddDuration instead of Add
This commit is contained in:
parent
c082c3bce3
commit
f2e20c81b6
67 changed files with 334 additions and 479 deletions
|
@ -65,14 +65,15 @@ func NewFuncMap() []template.FuncMap {
|
|||
"LoadTimes": func(startTime time.Time) string {
|
||||
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms"
|
||||
},
|
||||
"AvatarLink": base.AvatarLink,
|
||||
"Safe": Safe,
|
||||
"SafeJS": SafeJS,
|
||||
"Str2html": Str2html,
|
||||
"TimeSince": base.TimeSince,
|
||||
"RawTimeSince": base.RawTimeSince,
|
||||
"FileSize": base.FileSize,
|
||||
"Subtract": base.Subtract,
|
||||
"AvatarLink": base.AvatarLink,
|
||||
"Safe": Safe,
|
||||
"SafeJS": SafeJS,
|
||||
"Str2html": Str2html,
|
||||
"TimeSince": base.TimeSince,
|
||||
"TimeSinceUnix": base.TimeSinceUnix,
|
||||
"RawTimeSince": base.RawTimeSince,
|
||||
"FileSize": base.FileSize,
|
||||
"Subtract": base.Subtract,
|
||||
"Add": func(a, b int) int {
|
||||
return a + b
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue