aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bug/operation.go16
-rw-r--r--bug/operations/add_comment.go2
-rw-r--r--bug/operations/create.go2
-rw-r--r--bug/operations/create_test.go2
-rw-r--r--bug/snapshot.go2
-rw-r--r--cache/bug_excerpt.go2
6 files changed, 13 insertions, 13 deletions
diff --git a/bug/operation.go b/bug/operation.go
index 7d71e352..00313dc0 100644
--- a/bug/operation.go
+++ b/bug/operation.go
@@ -23,8 +23,8 @@ type Operation interface {
OpType() OperationType
// Time return the time when the operation was added
Time() time.Time
- // unixTime return the unix timestamp when the operation was added
- UnixTime() int64
+ // GetUnixTime return the unix timestamp when the operation was added
+ GetUnixTime() int64
// Apply the operation to a Snapshot to create the final state
Apply(snapshot Snapshot) Snapshot
// Files return the files needed by this operation
@@ -38,7 +38,7 @@ type Operation interface {
type OpBase struct {
OperationType OperationType
Author Person
- unixTime int64
+ UnixTime int64
}
// NewOpBase is the constructor for an OpBase
@@ -46,7 +46,7 @@ func NewOpBase(opType OperationType, author Person) OpBase {
return OpBase{
OperationType: opType,
Author: author,
- unixTime: time.Now().Unix(),
+ UnixTime: time.Now().Unix(),
}
}
@@ -57,12 +57,12 @@ func (op OpBase) OpType() OperationType {
// Time return the time when the operation was added
func (op OpBase) Time() time.Time {
- return time.Unix(op.unixTime, 0)
+ return time.Unix(op.UnixTime, 0)
}
-// unixTime return the unix timestamp when the operation was added
-func (op OpBase) UnixTime() int64 {
- return op.unixTime
+// GetUnixTime return the unix timestamp when the operation was added
+func (op OpBase) GetUnixTime() int64 {
+ return op.UnixTime
}
// Files return the files needed by this operation
diff --git a/bug/operations/add_comment.go b/bug/operations/add_comment.go
index 5ecc471a..b4126a8e 100644
--- a/bug/operations/add_comment.go
+++ b/bug/operations/add_comment.go
@@ -21,7 +21,7 @@ func (op AddCommentOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
Message: op.Message,
Author: op.Author,
Files: op.files,
- UnixTime: op.UnixTime(),
+ UnixTime: op.UnixTime,
}
snapshot.Comments = append(snapshot.Comments, comment)
diff --git a/bug/operations/create.go b/bug/operations/create.go
index 5fc939dd..ecbafb6f 100644
--- a/bug/operations/create.go
+++ b/bug/operations/create.go
@@ -22,7 +22,7 @@ func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
{
Message: op.Message,
Author: op.Author,
- UnixTime: op.UnixTime(),
+ UnixTime: op.UnixTime,
},
}
snapshot.Author = op.Author
diff --git a/bug/operations/create_test.go b/bug/operations/create_test.go
index 319cdb7f..a20472d3 100644
--- a/bug/operations/create_test.go
+++ b/bug/operations/create_test.go
@@ -21,7 +21,7 @@ func TestCreate(t *testing.T) {
expected := bug.Snapshot{
Title: "title",
Comments: []bug.Comment{
- {Author: rene, Message: "message", UnixTime: create.UnixTime()},
+ {Author: rene, Message: "message", UnixTime: create.UnixTime},
},
Author: rene,
CreatedAt: create.Time(),
diff --git a/bug/snapshot.go b/bug/snapshot.go
index 1ef4534b..59dcae7e 100644
--- a/bug/snapshot.go
+++ b/bug/snapshot.go
@@ -51,5 +51,5 @@ func (snap Snapshot) LastEditUnix() int64 {
return 0
}
- return snap.Operations[len(snap.Operations)-1].UnixTime()
+ return snap.Operations[len(snap.Operations)-1].GetUnixTime()
}
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go
index 62b5eedb..a9dd6abb 100644
--- a/cache/bug_excerpt.go
+++ b/cache/bug_excerpt.go
@@ -27,7 +27,7 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt {
Id: b.Id(),
CreateLamportTime: b.CreateLamportTime(),
EditLamportTime: b.EditLamportTime(),
- CreateUnixTime: b.FirstOp().UnixTime(),
+ CreateUnixTime: b.FirstOp().GetUnixTime(),
EditUnixTime: snap.LastEditUnix(),
Status: snap.Status,
Author: snap.Author,