Replace attributes map with new Attribute object

This commit is contained in:
Alex Dadgar
2018-10-13 14:08:58 -07:00
parent 521a1cf22f
commit 41bd0da920
3 changed files with 41 additions and 5 deletions

View File

@@ -88,3 +88,16 @@ func Pow(a, b int64) int64 {
}
return p
}
// CopyMapStringAttribute copies a map of string to Attribute
func CopyMapStringAttribute(in map[string]*Attribute) map[string]*Attribute {
if in == nil {
return nil
}
out := make(map[string]*Attribute, len(in))
for k, v := range in {
out[k] = v.Copy()
}
return out
}