diff options
Diffstat (limited to 'bug/operations/add_comment.go')
-rw-r--r-- | bug/operations/add_comment.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bug/operations/add_comment.go b/bug/operations/add_comment.go index 66725915..f35c572b 100644 --- a/bug/operations/add_comment.go +++ b/bug/operations/add_comment.go @@ -13,13 +13,6 @@ type AddCommentOperation struct { Message string } -func NewAddCommentOp(author bug.Person, message string) AddCommentOperation { - return AddCommentOperation{ - OpBase: bug.NewOpBase(bug.AddCommentOp, author), - Message: message, - } -} - func (op AddCommentOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { comment := bug.Comment{ Message: op.Message, @@ -32,6 +25,14 @@ func (op AddCommentOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { return snapshot } +func NewAddCommentOp(author bug.Person, message string) AddCommentOperation { + return AddCommentOperation{ + OpBase: bug.NewOpBase(bug.AddCommentOp, author), + Message: message, + } +} + +// Convenience function to apply the operation func Comment(b *bug.Bug, author bug.Person, message string) { addCommentOp := NewAddCommentOp(author, message) b.Append(addCommentOp) |