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
|
@ -33,9 +33,9 @@ func TestCreateComment(t *testing.T) {
|
|||
assert.EqualValues(t, "Hello", comment.Content)
|
||||
assert.EqualValues(t, issue.ID, comment.IssueID)
|
||||
assert.EqualValues(t, doer.ID, comment.PosterID)
|
||||
AssertInt64InRange(t, now, then, comment.CreatedUnix)
|
||||
AssertInt64InRange(t, now, then, int64(comment.CreatedUnix))
|
||||
AssertExistsAndLoadBean(t, comment) // assert actually added to DB
|
||||
|
||||
updatedIssue := AssertExistsAndLoadBean(t, &Issue{ID: issue.ID}).(*Issue)
|
||||
AssertInt64InRange(t, now, then, updatedIssue.UpdatedUnix)
|
||||
AssertInt64InRange(t, now, then, int64(updatedIssue.UpdatedUnix))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue