diff options
author | Amine <hilalyamine@gmail.com> | 2019-08-13 16:47:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-13 16:47:24 +0200 |
commit | cf960bc7a5bd0b7af28d35de33131fb0b5ce5253 (patch) | |
tree | 5df133c91bb4e1ccc5f9fbeb4664416b93d23bf5 /entity/merge.go | |
parent | 146894a5657d3b20dbaf769a950b12bd19df499c (diff) | |
parent | c809d37152ea87a66fc281730042dcb4299a8263 (diff) | |
download | git-bug-cf960bc7a5bd0b7af28d35de33131fb0b5ce5253.tar.gz |
Merge pull request #193 from MichaelMure/immutableID
Future proof the operation's ID
Diffstat (limited to 'entity/merge.go')
-rw-r--r-- | entity/merge.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/entity/merge.go b/entity/merge.go index 544f2168..7c3e71c8 100644 --- a/entity/merge.go +++ b/entity/merge.go @@ -1,6 +1,8 @@ package entity -import "fmt" +import ( + "fmt" +) // MergeStatus represent the result of a merge operation of an entity type MergeStatus int @@ -17,7 +19,7 @@ type MergeResult struct { // Err is set when a terminal error occur in the process Err error - Id string + Id Id Status MergeStatus // Only set for invalid status @@ -42,14 +44,14 @@ func (mr MergeResult) String() string { } } -func NewMergeError(err error, id string) MergeResult { +func NewMergeError(err error, id Id) MergeResult { return MergeResult{ Err: err, Id: id, } } -func NewMergeStatus(status MergeStatus, id string, entity Interface) MergeResult { +func NewMergeStatus(status MergeStatus, id Id, entity Interface) MergeResult { return MergeResult{ Id: id, Status: status, @@ -59,7 +61,7 @@ func NewMergeStatus(status MergeStatus, id string, entity Interface) MergeResult } } -func NewMergeInvalidStatus(id string, reason string) MergeResult { +func NewMergeInvalidStatus(id Id, reason string) MergeResult { return MergeResult{ Id: id, Status: MergeStatusInvalid, |