Skip to content

Commit 1752d10

Browse files
Copilotadlerjohn
andcommitted
docs: Add DeepCopy usage example to README
Update README to demonstrate proper usage of the exported DeepCopy function with RowRoots, showing the pattern for read-only vs modification scenarios. Co-authored-by: adlerjohn <[email protected]>
1 parent 5fdb965 commit 1752d10

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ func main() {
5050
// ColRoots failed
5151
}
5252

53+
// For read-only access, use the returned roots directly (fast).
54+
// For modification, create a deep copy to avoid affecting internal data:
55+
rowRootsCopy := rsmt2d.DeepCopy(rowRoots)
56+
// Now rowRootsCopy can be safely modified without affecting the original EDS
57+
_ = rowRootsCopy // Example: modify as needed
58+
5359
flattened := eds.Flattened()
5460

5561
// Delete some shares, just enough so that repairing is possible.

0 commit comments

Comments
 (0)