From 081c2a9395706e24bb396bf2aa9ac8a92d0a8f40 Mon Sep 17 00:00:00 2001 From: Bwko Date: Fri, 25 Nov 2016 09:03:52 +0100 Subject: [PATCH] Lint models/token.go (#244) --- models/token.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/token.go b/models/token.go index 42e0af7be2..03ea554fbb 100644 --- a/models/token.go +++ b/models/token.go @@ -28,14 +28,17 @@ type AccessToken struct { HasUsed bool `xorm:"-"` } +// BeforeInsert will be invoked by XORM before inserting a record representing this object. func (t *AccessToken) BeforeInsert() { t.CreatedUnix = time.Now().Unix() } +// BeforeUpdate is invoked from XORM before updating this object. func (t *AccessToken) BeforeUpdate() { t.UpdatedUnix = time.Now().Unix() } +// AfterSet is invoked from XORM after setting the value of a field of this object. func (t *AccessToken) AfterSet(colName string, _ xorm.Cell) { switch colName { case "created_unix":