Skip to content

Commit 914b218

Browse files
committed
gopls/internal/lsp/analysis/unusedparams: document the blank identifier
Improve documentation around the blank identifier in the unusedparams analyzer. Referring to "underscored" names is confusing, as that may reasonably be interpreted as referring to names like "_foo". Fixes golang/go#60682 Change-Id: I90e4bc47fad230c5843e69395c055ebe77ad498a Reviewed-on: https://go-review.googlesource.com/c/tools/+/524835 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent 8234134 commit 914b218

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

gopls/doc/analyzers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ any parameters that are not being used.
632632

633633
To reduce false positives it ignores:
634634
- methods
635-
- parameters that do not have a name or are underscored
635+
- parameters that do not have a name or have the name '_' (the blank identifier)
636636
- functions in test files
637637
- functions with empty bodies or those with just a return stmt
638638

gopls/internal/lsp/analysis/unusedparams/unusedparams.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ any parameters that are not being used.
2424
2525
To reduce false positives it ignores:
2626
- methods
27-
- parameters that do not have a name or are underscored
27+
- parameters that do not have a name or have the name '_' (the blank identifier)
2828
- functions in test files
2929
- functions with empty bodies or those with just a return stmt`
3030

gopls/internal/lsp/source/api_json.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)