Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that there are adequate tests for recursive slices. #28

Open
jmalloc opened this issue Jan 2, 2020 · 0 comments
Open

Check that there are adequate tests for recursive slices. #28

jmalloc opened this issue Jan 2, 2020 · 0 comments

Comments

@jmalloc
Copy link
Member

jmalloc commented Jan 2, 2020

In reviewing PR #27, which moves the recursion detection logic, I noticed this paragraph in the documentation of reflect.Type.Pointer():

If v's Kind is Slice, the returned pointer is to the first element of the slice. If the slice is nil the returned value is 0. If the slice is empty but non-nil the return value is non-zero.

I'm not sure about that "first element of the slice" thing, it seems like that might incorrectly render the recursion markers at the elements of the slice, rather than at the slice itself. We probably just want to make sure there is a test for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant