unparam

Find unused function parameters and results in Go code

Github stars Tracking Chart

unparam

go get mvdan.cc/unparam

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
  • 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 tags

It 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.

Main metrics

Overview
Name With Ownermvdan/unparam
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2017-03-04 12:22:48
Pushed At2025-03-01 12:50:50
Last Commit At2025-02-28 18:10:03
Release Count0
用户参与
Stargazers Count552
Watchers Count10
Fork Count29
Commits Count237
Has Issues Enabled
Issues Count61
Issue Open Count10
Pull Requests Count18
Pull Requests Open Count0
Pull Requests Close Count7
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private