-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mapstr: fix M.Clone behaviour for arrays of M (#262)
The current implementation does not clone in branches of slices in a mapstr.M, resulting in cases where the clone will share values with the original and allowing unexpected mutation of the original. This change fixes that by adding slices type handling. Note that this will not fix cases of unexpected sharing where the node value type is not a mapstr.M or map[string]any, so structs that are included with pointer fields will still show this effect.
- Loading branch information
Showing
2 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters