From 3605887345792d2f981f971c6c4a2cb7f86a343e Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Tue, 11 Sep 2018 22:04:16 +0200 Subject: reorganize package for a more idomatic go --- bug/operations/set_status.go | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 bug/operations/set_status.go (limited to 'bug/operations/set_status.go') diff --git a/bug/operations/set_status.go b/bug/operations/set_status.go deleted file mode 100644 index bafcf5ee..00000000 --- a/bug/operations/set_status.go +++ /dev/null @@ -1,39 +0,0 @@ -package operations - -import ( - "github.com/MichaelMure/git-bug/bug" -) - -// SetStatusOperation will change the status of a bug - -var _ bug.Operation = SetStatusOperation{} - -type SetStatusOperation struct { - bug.OpBase - Status bug.Status -} - -func (op SetStatusOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { - snapshot.Status = op.Status - - return snapshot -} - -func NewSetStatusOp(author bug.Person, status bug.Status) SetStatusOperation { - return SetStatusOperation{ - OpBase: bug.NewOpBase(bug.SetStatusOp, author), - Status: status, - } -} - -// Convenience function to apply the operation -func Open(b bug.Interface, author bug.Person) { - op := NewSetStatusOp(author, bug.OpenStatus) - b.Append(op) -} - -// Convenience function to apply the operation -func Close(b bug.Interface, author bug.Person) { - op := NewSetStatusOp(author, bug.ClosedStatus) - b.Append(op) -} -- cgit