From 6ea6f3614e46a62f4a37c6afb488547a3d548191 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 1 Oct 2018 23:31:16 +0200 Subject: bug: in op convenience function, return the new op to be able to set metadata later --- bug/op_set_status.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bug/op_set_status.go') diff --git a/bug/op_set_status.go b/bug/op_set_status.go index e40d349d..62f373ec 100644 --- a/bug/op_set_status.go +++ b/bug/op_set_status.go @@ -72,21 +72,21 @@ func (s SetStatusTimelineItem) Hash() git.Hash { } // Convenience function to apply the operation -func Open(b Interface, author Person, unixTime int64) error { +func Open(b Interface, author Person, unixTime int64) (*SetStatusOperation, error) { op := NewSetStatusOp(author, unixTime, OpenStatus) if err := op.Validate(); err != nil { - return err + return nil, err } b.Append(op) - return nil + return op, nil } // Convenience function to apply the operation -func Close(b Interface, author Person, unixTime int64) error { +func Close(b Interface, author Person, unixTime int64) (*SetStatusOperation, error) { op := NewSetStatusOp(author, unixTime, ClosedStatus) if err := op.Validate(); err != nil { - return err + return nil, err } b.Append(op) - return nil + return op, nil } -- cgit