Skip to content

io/fs: add clearer documentation for "unrooted" paths #42716

Open
@mpx

Description

@mpx

io/fs requires "unrooted" paths, but it is currently only documented in passing under io/fs.ValidPath.

This may be surprising to many developers starting to use io/fs. Eg, walking "/" on os.DirFS or embed.FS filesystems will fail. Walking "." is less obvious since this is traditionally associated with the current working directory which doesn't exist for virtual filesystems.

Cc @rsc

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions