1load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") 2 3go_test( 4 name = "go_default_test", 5 size = "small", 6 srcs = ["build_constraints_test.go"], 7 embed = [":go_default_library"], 8) 9 10go_library( 11 name = "go_default_library", 12 srcs = [ 13 # Check suffixes are filtered. 14 "suffix_linux.go", 15 "suffix_unknown.go", 16 # Check that tags are observed. 17 "tag_l.go", 18 "tag_unknown.go", 19 # Check that constraints apply to assembly files. 20 "asm_arm64.s", 21 "asm_linux_amd64.s", 22 "asm_unknown.s", 23 # Check that constraints apply to cgo files. 24 "cgo_linux.go", 25 "cgo_unknown.go", 26 "cgo_linux.c", 27 "cgo_unknown.c", 28 ":c_srcs_group", 29 ], 30 cgo = True, 31 importpath = "github.com/bazelbuild/rules_go/tests/build_constraints", 32) 33 34filegroup( 35 name = "c_srcs_group", 36 srcs = [ 37 "cgo_group_linux.c", 38 "cgo_group_unknown.c", 39 ], 40) 41