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

io/fs: misleading documentation of Glob function #43537

Closed
gazerro opened this issue Jan 6, 2021 · 1 comment
Closed

io/fs: misleading documentation of Glob function #43537

gazerro opened this issue Jan 6, 2021 · 1 comment
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@gazerro
Copy link
Contributor

gazerro commented Jan 6, 2021

The documentation of the new fs.Glob function is a bit misleading.

When it says

Glob returns the names of all files matching pattern or nil if there is no matching file. The syntax of patterns is the same as in path.Match. The pattern may describe hierarchical names such as /usr/*/bin/ed (assuming the Separator is '/').

the last sentence is correct but refers to a specific OS file system implementation, as the file system returned by the os.DirFS function. If "/usr/*/bin/ed" is used as pattern argument to Glob, it will never return any files because the names returned by Glob are unrooted.

@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Jan 7, 2021
@ianlancetaylor ianlancetaylor added this to the Go1.16 milestone Jan 7, 2021
@gopherbot
Copy link

Change https://golang.org/cl/282173 mentions this issue: io/fs: minor corrections to Glob doc

@golang golang locked and limited conversation to collaborators Jan 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants