Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mvdan/unparam
Find unused parameters in Go
https://github.com/mvdan/unparam
arguments functions go linter parameters results unused
Last synced: about 10 hours ago
JSON representation
Find unused parameters in Go
- Host: GitHub
- URL: https://github.com/mvdan/unparam
- Owner: mvdan
- License: bsd-3-clause
- Created: 2017-03-04T12:22:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-17T08:48:07.000Z (about 2 months ago)
- Last Synced: 2024-11-06T13:05:28.512Z (7 days ago)
- Topics: arguments, functions, go, linter, parameters, results, unused
- Language: Go
- Homepage:
- Size: 238 KB
- Stars: 531
- Watchers: 10
- Forks: 28
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# unparam
go install mvdan.cc/unparam@latest
Reports unused function parameters and results in your code.
To minimise false positives, it ignores certain cases such as:
* Exported functions (by default, see `-exported`)
* Unnamed and underscore parameters (like `_` and `_foo`)
* Funcs that may satisfy an interface
* Funcs that may satisfy a function signature
* Funcs that are stubs (empty, only error, immediately return, etc)
* Funcs that have multiple implementations via build tagsIt also reports results that always return the same value, parameters
that always receive the same value, and results that are never used. In
the last two cases, a minimum number of calls is required to ensure that
the warnings are useful.False positives can still occur by design. The aim of the tool is to be
as precise as possible - if you find any mistakes, file a bug.