For now, Kamino does not support circular slices and maps. Additionally, if two slices in the source object point to the same underlying array, this feature will not be kept in the copy object. Therefore, these cases will cause a stack overflow:
func TestCircularSlice(t *testing.T) {
a := []any{nil}
a[0] = a
cp, err := kamino.Clone(a)
assert.NoError(t, err)
assert.Equal(t, cp, a)
}
func TestCircularMap(t *testing.T) {
a := map[string]any{"a": nil}
a["a"] = a
cp, err := kamino.Clone(a)
assert.NoError(t, err)
assert.Equal(t, cp, a)
}
For now, Kamino does not support circular slices and maps. Additionally, if two slices in the source object point to the same underlying array, this feature will not be kept in the copy object. Therefore, these cases will cause a stack overflow: