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: invalid path in DirEntry.Name documentation example #47485

Closed
gazerro opened this issue Jul 31, 2021 · 1 comment · Fixed by ferrmin/go#120
Closed

io/fs: invalid path in DirEntry.Name documentation example #47485

gazerro opened this issue Jul 31, 2021 · 1 comment · Fixed by ferrmin/go#120
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@gazerro
Copy link
Contributor

gazerro commented Jul 31, 2021

The example in the documentation of the DirEntry.Name method, in the io/fs package, refers to the path /home/gopher/hello.go

// Name returns the name of the file (or subdirectory) described by the entry.
// This name is only the final element of the path (the base name), not the entire path.
// For example, Name would return "hello.go" not "/home/gopher/hello.go".
Name() string

but it cannot be the entire path because it is not a valid path. It should be home/gopher/hello.go, without the leading slash.

@gopherbot
Copy link

Change https://golang.org/cl/338889 mentions this issue: io/fs: don't use absolute pah in DirEntry.Name doc

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 2, 2021
@dmitshur dmitshur added this to the Go1.17 milestone Aug 2, 2021
@golang golang locked and limited conversation to collaborators Aug 2, 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants