diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-12 16:57:04 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-12 16:57:46 +0200 |
commit | 60fcfcdcb0e89741528cfc99a94a48f204d48e6b (patch) | |
tree | 48189b7f85e10b1bdf6a4b897ac0b966c4cec23c /operations/add_comment.go | |
parent | 3605887345792d2f981f971c6c4a2cb7f86a343e (diff) | |
download | git-bug-60fcfcdcb0e89741528cfc99a94a48f204d48e6b.tar.gz |
bug: change the OperationPack serialization format for Json
See https://github.com/MichaelMure/git-bug/issues/5 for the details of this choice
Diffstat (limited to 'operations/add_comment.go')
-rw-r--r-- | operations/add_comment.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/operations/add_comment.go b/operations/add_comment.go index 24fa2696..8c4b8b9c 100644 --- a/operations/add_comment.go +++ b/operations/add_comment.go @@ -11,16 +11,16 @@ var _ bug.Operation = AddCommentOperation{} type AddCommentOperation struct { bug.OpBase - Message string + Message string `json:"message"` // TODO: change for a map[string]util.hash to store the filename ? - files []git.Hash + Files []git.Hash `json:"files"` } func (op AddCommentOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { comment := bug.Comment{ Message: op.Message, Author: op.Author, - Files: op.files, + Files: op.Files, UnixTime: op.UnixTime, } @@ -29,15 +29,15 @@ func (op AddCommentOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { return snapshot } -func (op AddCommentOperation) Files() []git.Hash { - return op.files +func (op AddCommentOperation) GetFiles() []git.Hash { + return op.Files } func NewAddCommentOp(author bug.Person, message string, files []git.Hash) AddCommentOperation { return AddCommentOperation{ OpBase: bug.NewOpBase(bug.AddCommentOp, author), Message: message, - files: files, + Files: files, } } |