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

utils: add Walk function to walk over a filesystem #17

Merged
merged 3 commits into from Aug 4, 2021

Conversation

tjamet
Copy link
Contributor

@tjamet tjamet commented Jun 1, 2021

Adapted from the official filepath.Walk, this function allows to walk
trough a whole filesystem and discover all its files

@mcuadros mcuadros changed the title Add a function to walk over a filesystem utils: add Walk function to walk over a filesystem Jun 3, 2021
import (
"errors"
"fmt"
"io/fs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we usually keep compatibility to the two previous versions... can you avoid the usage of io/fs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! I will replace it with what is required

tjamet and others added 2 commits June 3, 2021 19:59
Adapted from the official filepath.Walk, this function allows to walk
trough a whole filesystem and discover all its files
fs.FileInfo has been introduced in go 1.16.5:
golang/go@d4da735#diff-46ea5b4a04796237678b36cd31d68f74209c90d604123f15dcc4bcb605dbc136

go-billy supports the 2 latest versions
The latest version of go is currently 1.16, hence use the previous
instance in os instead
@mcuadros mcuadros merged commit 7ab80d7 into go-git:master Aug 4, 2021
@nwalters512
Copy link

@mcuadros very excited to see this land! Can we expect a new tagged version containing this change soon?

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

Successfully merging this pull request may close these issues.

None yet

3 participants