diff options
author | Michael Muré <batolettre@gmail.com> | 2019-08-12 16:12:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-08-12 16:12:14 +0200 |
commit | 99b5c58d43137bd9f6503788a55484327b0c531f (patch) | |
tree | 08ecc0f923b5f1fb4e8a7627aeabccb335d92ad1 /entity/merge.go | |
parent | 67a3752e176790e82a48706236f889cab4f8913d (diff) | |
download | git-bug-99b5c58d43137bd9f6503788a55484327b0c531f.tar.gz |
finish the refactoring for the dedicated identifier type
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, |