+ relnote
Fixes #18022
Change-Id: I92d1939e9d9f16824655c6c909a5f58ed9500014
Reviewed-on: https://go-review.googlesource.com/c/go/+/661519
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
### Cgo {#cgo}
+### Vet {#vet}
+
+<!-- go.dev/issue/18022 -->
+
+The `go vet` command now includes the
+[waitgroup](https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/waitgroup)
+analyzer, which reports misplaced calls to [sync.WaitGroup.Add].
+
+
"unreachable": true,
"unsafeptr": true,
"unusedresult": true,
+ "waitgroup": true,
}
unreachable check for unreachable code
unsafeptr check for invalid conversions of uintptr to unsafe.Pointer
unusedresult check for unused results of calls to some functions
+ waitgroup check for misuses of sync.WaitGroup
For details and flags of a particular check, such as printf, run "go tool vet help printf".
"golang.org/x/tools/go/analysis/passes/unreachable"
"golang.org/x/tools/go/analysis/passes/unsafeptr"
"golang.org/x/tools/go/analysis/passes/unusedresult"
- _ "golang.org/x/tools/go/analysis/passes/waitgroup" // vendoring placeholder
+ "golang.org/x/tools/go/analysis/passes/waitgroup"
)
func main() {
unreachable.Analyzer,
unsafeptr.Analyzer,
unusedresult.Analyzer,
+ waitgroup.Analyzer,
)
// It's possible that unitchecker will exit early. In
"unmarshal",
"unsafeptr",
"unused",
+ "waitgroup",
} {
- pkg := pkg
t.Run(pkg, func(t *testing.T) {
t.Parallel()