aboutsummaryrefslogtreecommitdiffstats
path: root/identity/version.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-01-24 00:30:13 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-08 17:19:57 +0100
commit74e91144105790cc997c1d79a7f638e1e3a1f3f8 (patch)
tree33ef7b3cf547afc10b613e5d4de087ca0439232b /identity/version.go
parent8da522d97af3dcaca8a8424e3541705c69779d6f (diff)
downloadgit-bug-74e91144105790cc997c1d79a7f638e1e3a1f3f8.tar.gz
more more wip
Diffstat (limited to 'identity/version.go')
-rw-r--r--identity/version.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/identity/version.go b/identity/version.go
index 85195049..f9c7b262 100644
--- a/identity/version.go
+++ b/identity/version.go
@@ -30,7 +30,7 @@ type Version struct {
// The set of keys valid at that time, from this version onward, until they get removed
// in a new version. This allow to have multiple key for the same identity (e.g. one per
// device) as well as revoke key.
- keys []Key
+ keys []*Key
// This optional array is here to ensure a better randomness of the identity id to avoid collisions.
// It has no functional purpose and should be ignored.
@@ -53,24 +53,22 @@ type VersionJSON struct {
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
AvatarUrl string `json:"avatar_url,omitempty"`
- Keys []Key `json:"pub_keys,omitempty"`
+ Keys []*Key `json:"pub_keys,omitempty"`
Nonce []byte `json:"nonce,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
// Make a deep copy
func (v *Version) Clone() *Version {
-
clone := &Version{
name: v.name,
email: v.email,
avatarURL: v.avatarURL,
- keys: make([]Key, len(v.keys)),
- metadata: make(map[string]string),
+ keys: make([]*Key, len(v.keys)),
}
- for i, op := range opp.Operations {
- clone.Operations[i] = op
+ for i, key := range v.keys {
+ clone.keys[i] = key.Clone()
}
return clone