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_add_comment.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bug/op_add_comment.go') diff --git a/bug/op_add_comment.go b/bug/op_add_comment.go index 3b2c2b76..e304a6ef 100644 --- a/bug/op_add_comment.go +++ b/bug/op_add_comment.go @@ -83,15 +83,15 @@ type AddCommentTimelineItem struct { } // Convenience function to apply the operation -func AddComment(b Interface, author Person, unixTime int64, message string) error { +func AddComment(b Interface, author Person, unixTime int64, message string) (*AddCommentOperation, error) { return AddCommentWithFiles(b, author, unixTime, message, nil) } -func AddCommentWithFiles(b Interface, author Person, unixTime int64, message string, files []git.Hash) error { +func AddCommentWithFiles(b Interface, author Person, unixTime int64, message string, files []git.Hash) (*AddCommentOperation, error) { addCommentOp := NewAddCommentOp(author, unixTime, message, files) if err := addCommentOp.Validate(); err != nil { - return err + return nil, err } b.Append(addCommentOp) - return nil + return addCommentOp, nil } -- cgit