]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: add directive analyzer
authorRuss Cox <rsc@golang.org>
Sat, 14 Jan 2023 18:57:08 +0000 (13:57 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 30 Jan 2023 19:25:52 +0000 (19:25 +0000)
commit709b6578722b0b1cb074f819e5cb22960fa31180
treea63b2642cb55a176269cd519baa6c68072d1c83a
parent848d658c45b185efb6742e51ba261cbba801b6ee
cmd/vet: add directive analyzer

For #56986, add the new directive analyzer that catches
misplaced //go:debug lines.

Ran 'go mod vendor' after adding the import in vet
to bring in the vendored files.

A followup CL will enable it by default in 'go test'.

Change-Id: I12c46e292b31bdbf5ceb86ba4474545e78a83a47
Reviewed-on: https://go-review.googlesource.com/c/go/+/462201
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/directive/directive.go [new file with mode: 0644]
src/cmd/vendor/modules.txt
src/cmd/vet/main.go
src/cmd/vet/testdata/directive/directive.go [new file with mode: 0644]
src/cmd/vet/vet_test.go