Skip to content

go/build: missing Position information for go:embed patterns #43632

Closed
@bcmills

Description

@bcmills

Go 1.16 adds support for go:embed patterns in source files (#41191), which are parsed and reported by the go/build package in the {,Test,XTest}EmbedPatterns fields of the build.Package struct as of CL 243941.

Much like imports, embed patterns can introduce errors in the build due to missing inputs — in this case, missing embedded files. Those errors need to be attributed back to source file positions.

For imports, the build.Package struct represents the file and line information as token.Position values in the {,Test,XTest}ImportPos fields. However, the corresponding information for embed patterns seems not to be present.

This came to my attention via CL 280452.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions