diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2021-03-03 12:18:04 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-03 12:24:21 -0800 |
commit | 3e69f5d088d121f1d3c4bf44ca637a48f13c4819 (patch) | |
tree | 153fa7d51f509c8a5cf066a7aea90fd334a08899 /tools/checklocks/BUILD | |
parent | 80bc67c268dba0126cd258075c06d744399e0f02 (diff) |
Add checklocks analyzer.
This validates that struct fields if annotated with "// checklocks:mu" where
"mu" is a mutex field in the same struct then access to the field is only
done with "mu" locked.
All types that are guarded by a mutex must be annotated with
// +checklocks:<mutex field name>
For more details please refer to README.md.
PiperOrigin-RevId: 360729328
Diffstat (limited to 'tools/checklocks/BUILD')
-rw-r--r-- | tools/checklocks/BUILD | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/checklocks/BUILD b/tools/checklocks/BUILD new file mode 100644 index 000000000..7d4c63dc7 --- /dev/null +++ b/tools/checklocks/BUILD @@ -0,0 +1,16 @@ +load("//tools:defs.bzl", "go_library") + +package(licenses = ["notice"]) + +go_library( + name = "checklocks", + srcs = ["checklocks.go"], + nogo = False, + visibility = ["//tools/nogo:__subpackages__"], + deps = [ + "//pkg/log", + "@org_golang_x_tools//go/analysis:go_default_library", + "@org_golang_x_tools//go/analysis/passes/buildssa:go_default_library", + "@org_golang_x_tools//go/ssa:go_default_library", + ], +) |