load("@io_bazel_rules_go//go:def.bzl", "nogo")

nogo(
    name = "nogo_vet",
    config = "nogo_config.json",
    visibility = ["//visibility:public"],
    deps = [
        "@org_golang_x_tools//go/analysis/passes/unusedresult:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/unsafeptr:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/unreachable:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/unmarshal:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/tests:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/structtag:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/stdmethods:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/shift:go_tool_library",
        ## Disable checking for variable declarations that shadow others
        # "@org_golang_x_tools//go/analysis/passes/shadow:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/printf:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/pkgfact:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/nilness:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/nilfunc:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/lostcancel:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/loopclosure:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/httpresponse:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/findcall:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/deepequalerrors:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/ctrlflow:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/copylock:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/composite:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/cgocall:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/buildtag:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/buildssa:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/bools:go_tool_library",
        ## Disable atomicalign check as it fails when building with linux/arm
        ## --platforms flag.
        ## To reproduce, run:
        ## bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_arm @io_k8s_apiserver//pkg/server:go_default_library
        ## using ref eb61adf0fc3a38b0767df8d3cde16d4ed9e61d3d (HEAD of master).
        # "@org_golang_x_tools//go/analysis/passes/atomicalign:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/atomic:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/assign:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/inspect:go_tool_library",
        "@org_golang_x_tools//go/analysis/passes/asmdecl:go_tool_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [":package-srcs"],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
