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/create.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/create.go')
-rw-r--r-- | operations/create.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/operations/create.go b/operations/create.go index 81e5af93..a671171e 100644 --- a/operations/create.go +++ b/operations/create.go @@ -11,9 +11,9 @@ var _ bug.Operation = CreateOperation{} type CreateOperation struct { bug.OpBase - Title string - Message string - files []git.Hash + Title string `json:"title"` + Message string `json:"message"` + Files []git.Hash `json:"files"` } func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { @@ -30,8 +30,8 @@ func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { return snapshot } -func (op CreateOperation) Files() []git.Hash { - return op.files +func (op CreateOperation) GetFiles() []git.Hash { + return op.Files } func NewCreateOp(author bug.Person, title, message string, files []git.Hash) CreateOperation { @@ -39,7 +39,7 @@ func NewCreateOp(author bug.Person, title, message string, files []git.Hash) Cre OpBase: bug.NewOpBase(bug.CreateOp, author), Title: title, Message: message, - files: files, + Files: files, } } |