aboutsummaryrefslogtreecommitdiff
path: root/object
diff options
context:
space:
mode:
Diffstat (limited to 'object')
-rw-r--r--object/blob/clone.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/object/blob/clone.go b/object/blob/clone.go
new file mode 100644
index 00000000..7106c3aa
--- /dev/null
+++ b/object/blob/clone.go
@@ -0,0 +1,11 @@
+package blob
+
+import "bytes"
+
+// Clone returns a deep copy of the blob
+// whose Data is independent of any memory the original may alias.
+//
+// Labels: Life-Independent.
+func (blob *Blob) Clone() *Blob {
+ return &Blob{Data: bytes.Clone(blob.Data)}
+}