Skip to content

proposal: embed: treat / as module's root in go:embed directive #58525

@gucio321

Description

@gucio321

Consider the following code:

//go:embed /example/path
var data embed.FS

f, err := data.Open("example/path/file.txt")

Since fs.ValidPath, sadly Open will not be able to handle this / at the beginning, but it could be treated as module's root (in go:embed directive) and than removed from embed.FS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions