Bazel go test: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Overview= =Example= <syntaxhighlight lang='go'> load("//meta/rules:go.bzl", "go_library", "go_binary") go_library( name = "somepkg_lib", srcs = [ "file1.go", "file2.go", ], importpath = "github.com/someorg/somemodule/pkg/somepkg", visibility = ["//visibility:private"], deps = [ "//lib/a", "//lib/b", ... "@com_github_blang_semver//:semver", ], ) go_test( name = "somepkg_test", srcs = [...") |
|||
Line 1: | Line 1: | ||
=Internal= | |||
* [[Bazel_BUILD_Files#go_test|BUILD Files]] | |||
=Overview= | =Overview= | ||
=Example= | =Example= | ||
<syntaxhighlight lang='go'> | <syntaxhighlight lang='go'> |
Latest revision as of 03:42, 23 July 2024
Internal
Overview
Example
load("//meta/rules:go.bzl", "go_library", "go_binary")
go_library(
name = "somepkg_lib",
srcs = [
"file1.go",
"file2.go",
],
importpath = "github.com/someorg/somemodule/pkg/somepkg",
visibility = ["//visibility:private"],
deps = [
"//lib/a",
"//lib/b",
...
"@com_github_blang_semver//:semver",
],
)
go_test(
name = "somepkg_test",
srcs = [
"file1_test.go",
"file2_test.go",
],
embed = [": somepkg_lib"],
deps = ["@org_uber_go_goleak//:goleak"],
)