Skip to content

go: go_tool_library support for the //go:embed directive #2860

@farazdagi

Description

@farazdagi

What version of rules_go are you using?

v0.26.0

What version of gazelle are you using?

v0.23.0

What version of Bazel are you using?

3.7.0

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

OSX

What did you do?

I've been writing static code analyzer, so had to rely on go_tool_library (to avoid circular deps, which would occur if I've used go_library). Within that code analyzer, I wanted to use //go:embed directive, but it turns out that in #2806 support for that directive was added for go_library, go_binary, and go_test only.

What did you expect to see?

I expected that embedsrcs attribute is available for go_tool_library the same way it is available for go_library.

What did you see instead?

Instead I've seen that support for //go:embed was limited to go_library, go_binary, and go_test.

NB: I suppose go_embed_data might be used here, but since go 1.16 exposes native way of embedding, and rules_go do already implement new directive in go_library, it is probably worth implementing it in go_tool_library.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions