| load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "gomock") |
| |
| go_library( |
| name = "client", |
| srcs = [ |
| "client.go", |
| ], |
| importpath = "github.com/bazelbuild/rules_go/gomock/client", |
| visibility = ["//visibility:public"], |
| deps = [ |
| "@org_golang_google_genproto//googleapis/bytestream", |
| "@org_golang_google_grpc//:grpc", |
| ], |
| ) |
| |
| # Build the mocks using reflective mode (i.e. without passing source) |
| gomock( |
| name = "mocks", |
| out = "client_mock.go", |
| interfaces = ["Client"], |
| library = ":client", |
| package = "client", |
| visibility = ["//visibility:public"], |
| ) |
| |
| go_test( |
| name = "client_test", |
| srcs = [ |
| "client_mock.go", |
| "client_test.go", |
| ], |
| embed = [":client"], |
| deps = ["@com_github_golang_mock//gomock"], |
| ) |