diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-25 21:25:26 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-25 21:27:50 +0200 |
commit | 6706fa2bebcf5e1ff7001dbe82a9d79fa33ac096 (patch) | |
tree | ca346f24125a2d6b13d10f06dd8ddc06b6a30917 /bug/operations/add_comment.go | |
parent | 78355c887a9cc1b058a1bbc6ff38df54e34a96b4 (diff) | |
download | git-bug-6706fa2bebcf5e1ff7001dbe82a9d79fa33ac096.tar.gz |
some cleaning
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) |