tailscale/cmd/vet
Brad Fitzpatrick 9bb7ca6116 cmd/vet/lowerell, drive/driveimpl: forbid variables named "l" or "I"
Add a new vet checker that rejects variables, parameters, named
return values, receivers, range/type-switch bindings, type
parameters, struct fields, and constants named "l" (lowercase ell)
or "I" (uppercase i). Both are hard to distinguish from the digit
"1" and from each other in too many fonts.

Rename the two pre-existing struct fields named "l" (both of type
net.Listener) in drive/driveimpl/drive_test.go to "ln", matching the
convention used elsewhere for net.Listener locals.

Rename the test-fixture struct fields "I" (single int label) to
"Int" in metrics/multilabelmap_test.go and util/deephash/deephash_test.go,
preserving the "first letters of types" convention used alongside
neighboring fields like I8/I16/U/U8.

Also teach pkgdoc_test.go to skip testdata/ directories, which
the go tool ignores; they are not real packages.

Fixes #19631

Change-Id: I71ad2fa990705f7a070406ebcdb8cefa7487d849
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-05-04 14:03:28 -07:00
..
jsontags all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
lowerell cmd/vet/lowerell, drive/driveimpl: forbid variables named "l" or "I" 2026-05-04 14:03:28 -07:00
subtestnames cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
jsontags_allowlist k8s-operator,kube: allowing k8s api request events to be enabled via grants (#18393) 2026-01-16 13:29:12 +00:00
vet.go cmd/vet/lowerell, drive/driveimpl: forbid variables named "l" or "I" 2026-05-04 14:03:28 -07:00