diff --git a/go/private/rules/test.bzl b/go/private/rules/test.bzl index a7936ca9e5..9c5b4a6324 100644 --- a/go/private/rules/test.bzl +++ b/go/private/rules/test.bzl @@ -76,6 +76,7 @@ def _go_test_impl(ctx): ) external_source = go.library_to_source(go, struct( srcs = [struct(files = go_srcs)], + embedsrcs = [struct(files = internal_source.embedsrcs)], deps = internal_archive.direct + [internal_archive], x_defs = ctx.attr.x_defs, ), external_library, ctx.coverage_instrumented()) diff --git a/tests/core/go_library/BUILD.bazel b/tests/core/go_library/BUILD.bazel index 88c27dd8af..13a3956cdf 100644 --- a/tests/core/go_library/BUILD.bazel +++ b/tests/core/go_library/BUILD.bazel @@ -140,3 +140,9 @@ go_bazel_test( size = "medium", srcs = ["embedsrcs_error_test.go"], ) + +go_test( + name = "embedsrcs_simple_test", + srcs = ["embedsrcs_simple_test.go"], + embedsrcs = ["embedsrcs_static/no"], +) diff --git a/tests/core/go_library/embedsrcs_simple_test.go b/tests/core/go_library/embedsrcs_simple_test.go new file mode 100644 index 0000000000..32b3fdee45 --- /dev/null +++ b/tests/core/go_library/embedsrcs_simple_test.go @@ -0,0 +1,6 @@ +package embedsrcs_simple_test + +import _ "embed" + +//go:embed embedsrcs_static/no +var no []byte