1load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") 2 3go_library( 4 name = "cgo", 5 srcs = [ 6 "cgo.c", 7 "cgo.go", 8 ], 9 cgo = True, 10 importpath = "github.com/bazelbuild/rules_go/tests/empty_package/cgo", 11) 12 13go_library( 14 name = "mixed", 15 srcs = [ 16 "mixed_cgo.go", 17 "mixed_pure.go", 18 ], 19 importpath = "github.com/bazelbuild/rules_go/tests/empty_package/mixed", 20 deps = [":cgo"], 21) 22 23go_test( 24 name = "empty_package_cgo", 25 size = "small", 26 srcs = ["empty_package_test.go"], 27 pure = "off", 28 x_defs = { 29 "Expect": "2", 30 }, 31 deps = [":mixed"], 32) 33 34go_test( 35 name = "empty_package_pure", 36 size = "small", 37 srcs = ["empty_package_test.go"], 38 pure = "on", 39 x_defs = { 40 "Expect": "1", 41 }, 42 deps = [":mixed"], 43) 44