Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

cannot control walk via reflectwalk.SkipEntry #20

Description

@dncohen

I find it hard to control whether the walk visits objects or not.

In particular when SliceElem() returns reflectwalk.SkipEntry what I would expect is "don't descend into this element, but continue to the next one". But, what happens is "don't continue to the next one" (Contrast this behavior with StructField, where SkipEntry does continue to the next field. The comment in code says "pretends this field doesn't even exist".) I can't see any way to skip descending into a slice element, but do continue to visit the remaining elements.

Another troublesome aspect is that errors returned by Enter() and Exit() are simply ignored. I had to look into reflectwalk.go to figure out why returning SkipEntry there had no effect.

If I'm using the API incorrectly, please let me know. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions