aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations/create.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/operations/create.go')
-rw-r--r--bug/operations/create.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/bug/operations/create.go b/bug/operations/create.go
index 0fd1225e..4c1dd32e 100644
--- a/bug/operations/create.go
+++ b/bug/operations/create.go
@@ -14,14 +14,6 @@ type CreateOperation struct {
Message string
}
-func NewCreateOp(author bug.Person, title, message string) CreateOperation {
- return CreateOperation{
- OpBase: bug.NewOpBase(bug.CreateOp, author),
- Title: title,
- Message: message,
- }
-}
-
func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
snapshot.Title = op.Title
snapshot.Comments = []bug.Comment{
@@ -34,6 +26,15 @@ func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
return snapshot
}
+func NewCreateOp(author bug.Person, title, message string) CreateOperation {
+ return CreateOperation{
+ OpBase: bug.NewOpBase(bug.CreateOp, author),
+ Title: title,
+ Message: message,
+ }
+}
+
+// Convenience function to apply the operation
func Create(author bug.Person, title, message string) (*bug.Bug, error) {
newBug := bug.NewBug()
createOp := NewCreateOp(author, title, message)