...
1load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
2
3go_library(
4 name = "bin_with_tests_lib",
5 srcs = ["main.go"],
6 _gazelle_imports = [
7 "example.com/repo/lib",
8 "fmt",
9 ],
10 importpath = "example.com/repo/bin_with_tests",
11 visibility = ["//visibility:private"],
12)
13
14go_binary(
15 name = "bin_with_tests",
16 _gazelle_imports = [],
17 embed = [":bin_with_tests_lib"],
18 visibility = ["//visibility:public"],
19)
20
21go_test(
22 name = "bin_with_tests_test",
23 srcs = ["bin_test.go"],
24 _gazelle_imports = ["testing"],
25 embed = [":bin_with_tests_lib"],
26)
View as plain text