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/create.go | |
parent | 78355c887a9cc1b058a1bbc6ff38df54e34a96b4 (diff) | |
download | git-bug-6706fa2bebcf5e1ff7001dbe82a9d79fa33ac096.tar.gz git-bug-6706fa2bebcf5e1ff7001dbe82a9d79fa33ac096.zip |
some cleaning
Diffstat (limited to 'bug/operations/create.go')
-rw-r--r-- | bug/operations/create.go | 17 |
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) |