mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
use a Unix timestamp (int64) for the time instead of golang's Time that cause trouble for serialisation
This commit is contained in:
parent
fd4fa96c19
commit
13d7b3480b
@ -1,12 +1,10 @@
|
||||
package bug
|
||||
|
||||
import "time"
|
||||
|
||||
type Comment struct {
|
||||
Author Person
|
||||
Message string
|
||||
|
||||
// Creation time of the comment.
|
||||
// Should be used only for human display, never for ordering as we can't rely on it in a distributed system.
|
||||
Time time.Time
|
||||
Time int64
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ type AddCommentOperation struct {
|
||||
bug.OpBase
|
||||
Message string
|
||||
Author bug.Person
|
||||
Time time.Time
|
||||
Time int64
|
||||
}
|
||||
|
||||
func NewAddCommentOp(author bug.Person, message string) AddCommentOperation {
|
||||
@ -19,7 +19,7 @@ func NewAddCommentOp(author bug.Person, message string) AddCommentOperation {
|
||||
OpBase: bug.OpBase{OperationType: bug.ADD_COMMENT},
|
||||
Message: message,
|
||||
Author: author,
|
||||
Time: time.Now(),
|
||||
Time: time.Now().Unix(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ type CreateOperation struct {
|
||||
Title string
|
||||
Message string
|
||||
Author bug.Person
|
||||
Time time.Time
|
||||
Time int64
|
||||
}
|
||||
|
||||
func NewCreateOp(author bug.Person, title, message string) CreateOperation {
|
||||
@ -24,7 +24,7 @@ func NewCreateOp(author bug.Person, title, message string) CreateOperation {
|
||||
Title: title,
|
||||
Message: message,
|
||||
Author: author,
|
||||
Time: time.Now(),
|
||||
Time: time.Now().Unix(),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user