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_create.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bug/op_create.go') diff --git a/bug/op_create.go b/bug/op_create.go index 2ac85ee1..45387d19 100644 --- a/bug/op_create.go +++ b/bug/op_create.go @@ -96,19 +96,19 @@ type CreateTimelineItem struct { } // Convenience function to apply the operation -func Create(author Person, unixTime int64, title, message string) (*Bug, error) { +func Create(author Person, unixTime int64, title, message string) (*Bug, *CreateOperation, error) { return CreateWithFiles(author, unixTime, title, message, nil) } -func CreateWithFiles(author Person, unixTime int64, title, message string, files []git.Hash) (*Bug, error) { +func CreateWithFiles(author Person, unixTime int64, title, message string, files []git.Hash) (*Bug, *CreateOperation, error) { newBug := NewBug() createOp := NewCreateOp(author, unixTime, title, message, files) if err := createOp.Validate(); err != nil { - return nil, err + return nil, createOp, err } newBug.Append(createOp) - return newBug, nil + return newBug, createOp, nil } -- cgit