nautilus/gateway

copy() of [][]string is not deep enough

berend opened this issue · 2 comments

We stumbled upon an error, where we merge schema with lists of lists. For those inner most list, the values are only merged for the last list entry. The reason for this is, that this line does copy() on a [][]string. How ever, copy is not a deep copy, therefore later this line changes the previous entry in newInsertionPoints. Outcome is, that newInsertionPoints only consists on the same insertions point (just the last one). Then only the last list entry is correctly merged.

We have a fix (PR follows in a minute), but no test yet. Also the "deep" copy is not really elegant.

If you have an idea/direction how to improve the deep copy - or write a test for this, I would love to add this to the PR.

Whoa, nice find!! I'm really not sure of a better alternative for the deep copy unforuntately :(

I think this can be closed now