diff options
| author | 2026-06-13 15:57:20 +0000 | |
|---|---|---|
| committer | 2026-06-13 15:57:20 +0000 | |
| commit | 8f3a433601efbc2d00be8204d6f67b636fda83a0 (patch) | |
| tree | be1387234e731be2b5b7dffce574afe9a73afb4b /object | |
| parent | object/signature: Don't clone on parse (diff) | |
object/signature: Add Clone
Diffstat (limited to 'object')
| -rw-r--r-- | object/signature/clone.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/object/signature/clone.go b/object/signature/clone.go new file mode 100644 index 00000000..4637a258 --- /dev/null +++ b/object/signature/clone.go @@ -0,0 +1,16 @@ +package signature + +import "bytes" + +// Clone returns a deep copy of the signature +// whose Name and Email are independent of any memory the original may alias. +// +// Labels: Life-Independent. +func (signature Signature) Clone() Signature { + return Signature{ + Name: bytes.Clone(signature.Name), + Email: bytes.Clone(signature.Email), + WhenUnix: signature.WhenUnix, + OffsetMinutes: signature.OffsetMinutes, + } +} |
