Skip to content

path/filepath: add SkipAll #47209

Closed
Closed
@mvdan

Description

@mvdan

This is a re-opening of #43760, since the original author closed it - seemingly for their perception that there was no interest. The proposed API is small, the issue had six upvote reactions at the time of closing, and I personally think it's a good idea too, so I'm reopening here.

Since it's possible to delete GitHub comments or entire threads, I've made a waybackmachine copy as of today: https://web.archive.org/web/20210714212659/https://github.com/golang/go/issues/43760

In summary: Right now we have filepath.SkipDir for skipping an entire directory while walking via filepath.Walk, but nothing for stopping the walk entirely. It's possible to accomplish that by returning a custom error and ignoring it from the filepath.Walk error return, but that's a bit clunky. It would be nice to simply use StopWalk, and have Walk return a nil error when it's stopped that way.

The original issue was a proposal, but I don't think this is complex or controversial enough to need the process. I also think waiting to be selected for proposal review might have been what caused the confusion around the lack of interest.

cc @89z @ianlancetaylor @josharian
cc @robpike @rsc as per https://dev.golang.org/owners

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions