Skip to content

Commit

Permalink
gopls/internal/lsp/analysis/unusedparams: document the blank identifier
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
findleyr committed Aug 31, 2023
1 parent 8234134 commit 914b218
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gopls/doc/analyzers.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ any parameters that are not being used.

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

Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/lsp/analysis/unusedparams/unusedparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ any parameters that are not being used.
To reduce false positives it ignores:
- methods
- parameters that do not have a name or are underscored
- parameters that do not have a name or have the name '_' (the blank identifier)
- functions in test files
- functions with empty bodies or those with just a return stmt`

Expand Down
4 changes: 2 additions & 2 deletions gopls/internal/lsp/source/api_json.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 914b218

Please sign in to comment.