plezentek / rules_wire

Wire rules for Bazel
Apache License 2.0
6 stars 2 forks source link

How can I referer go.mod in root dir when I have many cmd/main.go to build ? Now I got `Source files must all be from the same package.` #4

Open edocevol opened 1 week ago

edocevol commented 1 week ago

sub command

wire_injector(
    name = "layout_wire_injector",
    srcs = [
        "server.go",
        "wire.go",
        "//:go_module_files",
    ],
)

root build

filegroup(
    name = "go_module_files",
    srcs = glob([
        "go.mod",
        "go.sum",
    ]),
    visibility = ["//visibility:public"],
)